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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.language-toggle {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-toggle:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.language-toggle:focus {
    outline: 2px solid #63b3ed;
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.game-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

/* Mode Selection */
.mode-selection {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.mode-btn {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.25);
    animation: blinkOnce 0.6s ease-in-out;
}

@keyframes blinkOnce {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.mode-btn span {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.mode-btn p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Learning Section */
.learning-section {
    max-width: 900px;
    margin: 0 auto;
}

.learning-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.learning-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.75rem;
}

.learning-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.learning-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.learning-card h3 {
    color: #1f2937;
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.learning-card p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.account-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.account-type {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.account-type:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.account-type.assets {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.account-type.liabilities {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.account-type.equity {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.account-type.revenue {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
}

.account-type.expenses {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.account-type h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.account-type p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.balance-info span {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
}

.examples {
    font-size: 0.8rem !important;
    font-style: italic;
    color: #9ca3af !important;
    margin: 0 !important;
}

.balance-rule ul {
    margin: 1rem 0;
    padding-left: 0;
    list-style: none;
}

.balance-rule li {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    font-weight: 500;
}

.example-section .example-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.debit-side {
    padding: 1rem;
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: #dc2626;
}

.credit-side {
    padding: 1rem;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: #16a34a;
}

.explanation {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem;
    font-style: italic;
    color: #1e40af !important;
    margin-top: 1rem !important;
}

.ready-section {
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
}

.start-games-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.start-games-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .mode-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .account-type-grid {
        grid-template-columns: 1fr;
    }
    
    .example-entry {
        grid-template-columns: 1fr !important;
    }
    
    .learning-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.game-area {
    animation: fadeIn 0.5s ease;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: #e2e8f0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #cbd5e0;
}

.score-info {
    font-weight: 500;
    color: #4a5568;
}

/* Progress Bar */
.progress-container {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #48bb78, #38a169);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* Question Container */
.question-container {
    animation: slideIn 0.4s ease;
}

.question-card {
    text-align: center;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    color: #2d3748;
    line-height: 1.5;
}

.answer-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.answer-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

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

.debit-btn:hover {
    border-color: #cbd5e0;
    background: #edf2f7;
}

.credit-btn:hover {
    border-color: #cbd5e0;
    background: #edf2f7;
}

.answer-btn:focus {
    outline: 2px solid #63b3ed;
    outline-offset: 2px;
}

/* Build Entry Mode */
.scenario-card {
    text-align: center;
}

.scenario-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #2d3748;
}

.entry-builder {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.entry-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.entry-line {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
}

.account-select {
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.amount-input {
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

.entry-totals {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
}

.total-amount {
    text-align: center;
}

.submit-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Feedback Panel */
.feedback-panel {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.feedback-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.feedback-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feedback-text {
    color: #4a5568;
    line-height: 1.6;
}

.feedback-panel.correct {
    background: #c6f6d5;
    border: 2px solid #38a169;
}

.feedback-panel.incorrect {
    background: #fed7d7;
    border: 2px solid #e53e3e;
}

/* Next Button */
.next-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.next-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

/* Results Summary */
.results-summary {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.results-summary h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.final-score {
    margin-bottom: 2rem;
}

.score-value {
    font-size: 2rem;
    font-weight: 600;
    color: #4299e1;
}

.weak-areas {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.weak-areas h4 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.weak-areas ul {
    list-style: none;
}

.weak-areas li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.weak-areas li:last-child {
    border-bottom: none;
}

.play-again-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-again-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.footer a:hover {
    color: white;
    border-bottom-color: white;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .game-title {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 1rem;
    }

    .game-container {
        padding: 1.5rem;
    }

    .mode-buttons {
        grid-template-columns: 1fr;
    }

    .answer-buttons {
        flex-direction: column;
        align-items: center;
    }

    .answer-btn {
        width: 100%;
        max-width: 200px;
    }

    .entry-header,
    .entry-line,
    .entry-totals {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    .question-text,
    .scenario-text {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .mode-btn {
        padding: 1.5rem;
        min-height: 120px;
    }

    .answer-btn {
        padding: 1.2rem 2rem;
        font-size: 1.2rem;
        min-height: 60px;
    }

    .language-toggle {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .entry-builder {
        padding: 1rem;
    }

    .account-select,
    .amount-input {
        padding: 0.75rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .submit-btn,
    .next-btn,
    .play-again-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-height: 56px;
    }
}
