/* Tetris Fixed Modal - Unique CSS to avoid conflicts */

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

.tetris-fx-fixed-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.tetris-fx-fixed-button:active {
    transform: translateY(0) scale(0.98);
}

.tetris-fx-icon {
    font-size: 20px;
    line-height: 1;
}

.tetris-fx-label {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Modal Container */
.tetris-fx-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.tetris-fx-modal.active {
    display: flex;
}

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

/* Modal Content */
.tetris-fx-modal-content {
    position: relative;
    background: linear-gradient(145deg, #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;
    display: flex;
    flex-direction: column;
    border: 2px solid #667eea;
}

/* Modal Header */
.tetris-fx-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-bottom: 2px solid #667eea;
}

.tetris-fx-modal-title {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tetris-fx-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.tetris-fx-close-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* Modal Body */
.tetris-fx-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tetris-fx-game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

#tetris-fx-canvas {
    background: #0a0a0a;
    border: 4px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

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

.tetris-fx-score-box,
.tetris-fx-level-box,
.tetris-fx-lines-box,
.tetris-fx-next-box {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.tetris-fx-score-label,
.tetris-fx-level-label,
.tetris-fx-lines-label,
.tetris-fx-next-label {
    color: #667eea;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.tetris-fx-score-value,
.tetris-fx-level-value,
.tetris-fx-lines-value {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

#tetris-fx-next {
    background: #0a0a0a;
    border-radius: 4px;
    margin: 0 auto;
}

.tetris-fx-controls-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #ccc;
    font-size: 12px;
    line-height: 1.6;
}

.tetris-fx-controls-info strong {
    color: #667eea;
}

.tetris-fx-controls-info p {
    margin: 4px 0;
}

/* Modal Footer */
.tetris-fx-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #667eea;
    justify-content: center;
}

.tetris-fx-start-button,
.tetris-fx-pause-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 32px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.tetris-fx-start-button:hover,
.tetris-fx-pause-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.tetris-fx-start-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Game Over Overlay */
.tetris-fx-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 12px;
    text-align: center;
    border: 3px solid #e74c3c;
    display: none;
}

.tetris-fx-game-over.show {
    display: block;
}

.tetris-fx-game-over h3 {
    color: #e74c3c;
    font-size: 28px;
    margin: 0 0 16px 0;
}

.tetris-fx-game-over p {
    color: #fff;
    font-size: 18px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tetris-fx-fixed-button {
        top: 10px !important;
        right: 10px !important;
        padding: 10px 16px;
    }
    
    .tetris-fx-label {
        display: none;
    }
    
    .tetris-fx-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .tetris-fx-game-container {
        flex-direction: column;
        align-items: center;
    }
    
    #tetris-fx-canvas {
        width: 250px;
        height: 500px;
    }
    
    .tetris-fx-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .tetris-fx-controls-info {
        display: none;
    }
}

/* Animation for modal open */
@keyframes tetris-fx-modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tetris-fx-modal.active .tetris-fx-modal-content {
    animation: tetris-fx-modal-slide-in 0.3s ease-out;
}

/* Focus styles for accessibility */
.tetris-fx-fixed-button:focus,
.tetris-fx-close-button:focus,
.tetris-fx-start-button:focus,
.tetris-fx-pause-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}