/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #FFD700, #FF8C00, #FF0000, #00FF00, #0000FF);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* Layout Principal */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 300px 300px;
    grid-template-rows: auto auto;
    gap: 20px;
    align-items: start;
}

.cube-container {
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

/* Painéis */
.controls-panel,
.algorithms-panel,
.math-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.controls-panel h3,
.algorithms-panel h3,
.math-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: #FFD700;
}

/* Botões */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
}

.btn-info {
    background: linear-gradient(45deg, #9C27B0, #7B1FA2);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

/* Controle de Velocidade */
.speed-control {
    margin-bottom: 20px;
}

.speed-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.speed-control input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

#speed-value {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* Movimentos Manuais */
.manual-moves h4 {
    margin-bottom: 10px;
    color: #FFD700;
}

.move-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.move-btn {
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.move-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Controles de Rotação */
.rotation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    width: 120px;
}

.rotation-controls button {
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Painel de Algoritmos */
.current-algorithm,
.algorithm-step,
.move-counter {
    margin-bottom: 15px;
}

.current-algorithm h4,
.algorithm-step h4,
.move-counter h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #FFD700;
}

.sequence-display,
.step-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
}

.counter {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: #4CAF50;
}

.algorithm-list {
    margin-top: 15px;
}

.algorithm-list h4 {
    margin-bottom: 10px;
    color: #FFD700;
}

.algorithm-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.algorithm-item strong {
    color: #4CAF50;
}

/* Painel de Matemática */
.cube-state,
.statistics,
.mathematical-info {
    margin-bottom: 20px;
}

.cube-state h4,
.statistics h4,
.mathematical-info h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #FFD700;
}

.state-display,
.stat-item,
.info-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.state-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.label {
    font-weight: bold;
    color: #ccc;
}

.value {
    color: #4CAF50;
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 1fr 280px;
        grid-template-rows: auto auto auto;
    }
    
    .cube-container {
        grid-row: 1;
        grid-column: 1 / 3;
    }
    
    .controls-panel {
        grid-row: 2;
        grid-column: 1;
    }
    
    .algorithms-panel {
        grid-row: 2;
        grid-column: 2;
    }
    
    .math-panel {
        grid-row: 3;
        grid-column: 1 / 3;
    }
}

@media (max-width: 768px) {
    .game-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    
    .cube-container,
    .controls-panel,
    .algorithms-panel,
    .math-panel {
        grid-column: 1;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .controls-panel,
    .algorithms-panel,
    .math-panel {
        padding: 15px;
    }
}

