/* ========================================
   Flip Card Game Styles
   ======================================== */

/* ========================================
   Container & Layout
   ======================================== */
.flipcard-game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* ========================================
   Game Start Screen
   ======================================== */
.game-start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.game-info-card {
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 16px;
}

.game-title {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.game-title i {
    color: #3498db;
    margin-right: 0.5rem;
}

.game-description {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat-box {
    text-align: center;
}

.stat-box i {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-instructions {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.game-instructions h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.game-instructions ol {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.game-instructions li {
    margin-bottom: 0.5rem;
    color: #555;
}

.start-game-btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.start-game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* ========================================
   Flip Card Component
   ======================================== */
.flip-card {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 2rem auto;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flip-card-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.flip-card-content {
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.flip-card-number {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.flip-icon {
    font-size: 4rem;
    margin: 2rem 0;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.flip-card-info {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    max-height: 250px;
    overflow-y: auto;
}

.flip-button {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.flip-button:hover {
    background: white;
    color: #667eea;
    transform: scale(1.05);
}

/* Shake Animations */
.flip-card.shake-success {
    animation: shakeSuccess 0.5s ease-in-out;
}

.flip-card.shake-error {
    animation: shakeError 0.5s ease-in-out;
}

@keyframes shakeSuccess {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) scale(1.02); }
    20%, 40%, 60%, 80% { transform: translateX(5px) scale(1.02); }
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ========================================
   Progress Tracker
   ======================================== */
.progress-tracker {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-progress {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-progress i {
    color: #3498db;
    margin-right: 0.5rem;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-display i {
    color: #f39c12;
    font-size: 1.5rem;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.score-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.progress-bar-container {
    margin: 1rem 0;
}

.progress {
    height: 12px;
    border-radius: 10px;
    background-color: #ecf0f1;
}

.progress-bar {
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    border-radius: 10px;
    font-size: 0.75rem;
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.stat-item.correct {
    color: #27ae60;
}

.stat-item.incorrect {
    color: #e74c3c;
}

.stat-item.timer {
    color: #3498db;
}

/* ========================================
   Answer Options
   ======================================== */
.answer-options {
    margin-top: 2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.option-button {
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 500;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-button:hover:not(:disabled) {
    border-color: #3498db;
    background: #ebf5fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.option-button.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.option-button.correct {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
    animation: pulseSuccess 0.5s ease-in-out;
}

.option-button.incorrect {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
    animation: pulseError 0.5s ease-in-out;
}

@keyframes pulseSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseError {
    0%, 100% { transform: scale(1); }
    25%, 75% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
}

.option-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.feedback-message {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-message.correct-feedback {
    background: #d5f4e6;
    border: 2px solid #27ae60;
    color: #1e7e34;
}

.feedback-message.incorrect-feedback {
    background: #fadbd8;
    border: 2px solid #e74c3c;
    color: #c0392b;
}

.feedback-message i {
    font-size: 1.5rem;
}

/* ========================================
   Game Actions
   ======================================== */
.answer-section {
    margin-top: 2rem;
}

.submit-section,
.next-section {
    text-align: center;
    margin-top: 2rem;
}

.submit-section button,
.next-section button {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.submit-section button:hover:not(:disabled),
.next-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Results Screen
   ======================================== */
.game-results-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.results-card {
    max-width: 700px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 16px;
}

.results-trophy {
    margin-bottom: 2rem;
}

.results-trophy i {
    font-size: 5rem;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.results-trophy h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-top: 1rem;
}

.results-stats {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 2rem;
}

.result-stat {
    text-align: center;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3498db;
    line-height: 1;
}

.result-label {
    font-size: 1rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.results-breakdown {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    font-size: 1.1rem;
}

.breakdown-item i {
    font-size: 1.5rem;
}

.breakdown-item.correct {
    color: #27ae60;
}

.breakdown-item.incorrect {
    color: #e74c3c;
}

.breakdown-item.time {
    color: #3498db;
}

.cards-to-review {
    border-top: 2px solid #ecf0f1;
    padding-top: 2rem;
}

.cards-to-review h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.review-list {
    max-height: 400px;
    overflow-y: auto;
}

.review-card {
    background: white;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.review-question {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.review-your-answer {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.review-correct-answer {
    color: #27ae60;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.results-actions button {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .flipcard-game-container {
        padding: 1rem;
    }

    .flip-card {
        height: 350px;
    }

    .flip-card-info {
        font-size: 1.1rem;
    }

    .game-stats {
        gap: 1.5rem;
    }

    .stat-box i {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .results-stats {
        gap: 1rem;
    }

    .result-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .flip-card {
        height: 300px;
    }

    .flip-card-content {
        padding: 1rem;
    }

    .progress-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .progress-stats {
        flex-direction: column;
        align-items: center;
    }
}
