/**
 * Tetris Corner Trigger - Styles
 */

/* ===== Fixed Trigger Button ===== */
.tetris-trigger-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.tetris-trigger-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.tetris-trigger-btn:active {
    transform: translateY(0) scale(0.98);
}

.tetris-trigger-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.tetris-btn-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ===== Modal Overlay ===== */
.tetris-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tetris-modal[hidden] {
    display: flex !important;
}

.tetris-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* ===== Modal Backdrop ===== */
.tetris-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* ===== Modal Content ===== */
.tetris-modal-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tetris-modal.is-open .tetris-modal-content {
    transform: scale(1);
}

/* ===== Modal Header ===== */
.tetris-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-modal-title {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tetris-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tetris-close-btn:hover {
    background: rgba(244, 67, 54, 0.8);
    transform: rotate(90deg);
}

.tetris-close-btn svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

/* ===== Modal Body ===== */
.tetris-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

/* ===== Game Container ===== */
.tetris-game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ===== Canvas ===== */
.tetris-canvas {
    background: #0f0f1a;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ===== Sidebar ===== */
.tetris-game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 120px;
}

.tetris-label {
    color: #888;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tetris-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.tetris-score-box,
.tetris-level-box,
.tetris-lines-box,
.tetris-next-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.tetris-next-canvas {
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 4px;
    margin: 0 auto;
    display: block;
}

/* ===== Controls Info ===== */
.tetris-controls-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
}

.tetris-control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    color: #ccc;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tetris-control-item:last-child {
    border-bottom: none;
}

.tetris-key {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* ===== Pause Button ===== */
.tetris-pause-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tetris-pause-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.tetris-pause-btn:active {
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .tetris-trigger-btn {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
    }

    .tetris-btn-text {
        display: none;
    }

    .tetris-game-container {
        flex-direction: column;
        align-items: center;
    }

    .tetris-canvas {
        width: 240px;
        height: 480px;
    }

    .tetris-game-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .tetris-score-box,
    .tetris-level-box,
    .tetris-lines-box,
    .tetris-next-box,
    .tetris-controls-info {
        flex: 1;
        min-width: 80px;
    }

    .tetris-control-item {
        font-size: 10px;
    }
}
