/**
 * Tetris Game Plugin Styles
 * Responsive modal window and game interface
 */

/* Floating Button */
.tetris-floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.tetris-floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.tetris-floating-button:active {
    transform: scale(0.95);
}

.tetris-floating-button svg {
    width: 24px;
    height: 24px;
}

.tetris-button-text {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Overlay */
.tetris-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tetrisFadeIn 0.3s ease;
}

@keyframes tetrisFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.tetris-modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: tetrisSlideIn 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@keyframes tetrisSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.tetris-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tetris-modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.tetris-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    transition: all 0.2s ease;
}

.tetris-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

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

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

/* Sidebar */
.tetris-sidebar {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tetris-info-panel,
.tetris-next-panel,
.tetris-controls-info {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    color: white;
}

.tetris-info-panel h3,
.tetris-next-panel h3,
.tetris-controls-info h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
}

.tetris-score-panel,
.tetris-level-panel,
.tetris-lines-panel {
    margin-bottom: 15px;
}

.tetris-score-panel:last-child,
.tetris-level-panel:last-child,
.tetris-lines-panel:last-child {
    margin-bottom: 0;
}

#tetris-score,
#tetris-level,
#tetris-lines {
    font-size: 32px;
    font-weight: 700;
    color: #00F0F0;
    text-align: center;
    margin-top: 10px;
}

/* Next Piece Panel */
#tetris-next-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #1a1a2e;
}

/* Controls Info */
.tetris-controls-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.tetris-controls-info li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tetris-controls-info li:last-child {
    border-bottom: none;
}

.tetris-controls-info strong {
    display: inline-block;
    min-width: 80px;
    color: #F0A000;
}

/* Main Panel */
.tetris-main-panel {
    position: relative;
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

#tetris-canvas {
    border: 3px solid #667eea;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

/* Game Over Overlay */
.tetris-game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.tetris-game-over-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.tetris-game-over-content h2 {
    font-size: 48px;
    margin: 0 0 20px 0;
    color: #F00000;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tetris-game-over-content p {
    font-size: 24px;
    margin: 0 0 30px 0;
}

#tetris-final-score {
    color: #00F0F0;
    font-weight: 700;
    font-size: 36px;
}

/* Buttons */
.tetris-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tetris-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tetris-game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .tetris-sidebar {
        width: 100%;
        max-width: 300px;
        order: 2;
    }
    
    .tetris-main-panel {
        order: 1;
        width: 100%;
    }
    
    #tetris-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .tetris-modal-body {
        padding: 20px;
    }
    
    .tetris-floating-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .tetris-button-text {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .tetris-modal-header {
        padding: 15px 20px;
    }
    
    .tetris-modal-header h2 {
        font-size: 22px;
    }
    
    .tetris-close-button {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .tetris-game-over-content h2 {
        font-size: 32px;
    }
    
    .tetris-game-over-content p {
        font-size: 18px;
    }
    
    #tetris-final-score {
        font-size: 28px;
    }
}
