/* ========================================
   ADHD Monsters Hack - Demo Game Styles (Optimized)
   ======================================== */

/* ========================================
   CSS Variables & Color Palette
   ======================================== */
:root {
    /* Halloween Color Palette */
    --orange: #CC5500;
    --charcoal: #2A2A2A;
    --mist: #5E355E;
    --copper: #DAA520;
    --brew: #556B2F;
    /* Inherit from main scheme */
    --biscuit: #F3E7D6;
    --cream: #F9F5EF;
    --smoke: #BFAFA0;
    --moss: #84A87C;
    --apricot: #E89B6E;

    /* Fonts */
    --font-family-primary: 'Playfair Display', serif;
    --font-family-headings: 'Cinzel', serif;
}

/* ========================================
   Reset & Base Styles (inherited from common.css)
   ======================================== */
/* CSS reset inherited from common.css */

/* Body styles inherited from common.css, only override background color */
body {
    background-color: var(--charcoal);
}

/* ========================================
   Demo Game Specific Typography
   ======================================== */
h1, h2, h3, h4 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: var(--copper);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--copper);
    text-transform: uppercase;
}

h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--copper);
}

h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 0;
    text-align: center;
    color: var(--copper);
}

.section-title {
    color: var(--copper);
    text-align: center;
    margin-bottom: 2rem;
}

/* ========================================
   Demo Game Specific Layout Overrides
   ======================================== */
section {
    padding: 50px 0;
}

/* ========================================
   Demo-specific header styling - inherits structure from common.css
   ======================================== */
/* Demo-specific header overrides - only colors, inherits all structure from common.css */
.sticky-header {
    background-color: var(--orange);
    border-bottom: 1px solid var(--charcoal);
}

.logo a {
    font-family: var(--font-family-headings);
    font-weight: 700;
}

.logo-accent {
    color: var(--mist);
}

.main-nav a {
    font-weight: 500;
}

.main-nav a:not(.select-mode-link):hover {
    color: var(--mist);
}

/* Demo-specific Select Mode hover styling */
.main-nav .select-mode-link:hover {
    color: var(--mist);
}

/* Demo-specific Halloween Quest hover styling (inherits from common.css but needs override) */
.main-nav .halloween-quest-link:hover {
    color: var(--orange);
}

/* ========================================
   Unified Button System
   ======================================== */
.btn,
.action-btn,
.mode-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-family: var(--font-family-primary);
    letter-spacing: 0.5px;
}

/* Button variants - inherit from common.css, only override colors */
.btn-donate {
    background-color: var(--copper);
    color: var(--charcoal);
}

.btn-donate:hover {
    background-color: var(--copper);
    color: var(--mist);
}

.primary-btn {
    background-color: var(--mist);
    color: var(--cream);
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--brew);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.quick-button,
.strategic-button {
    background-color: var(--mist);
    color: var(--cream);
}

.quick-button:hover,
.strategic-button:hover {
    background-color: var(--brew);
    color: var(--cream);
    transform: translateY(-2px);
}

/* Disabled state */
.action-btn:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Demo Game Specific Styles
   ======================================== */
.game-modes {
    background-color: var(--charcoal);
    padding: 3rem 0;
}

.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-mode-card {
    background-color: var(--biscuit);
    border: 3px solid var(--mist);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.game-mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--orange);
}

.mode-icon {
    margin-bottom: 1rem;
}

.mode-icon-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.mode-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--charcoal);
}

/* ========================================
   Halloween Theme
   ======================================== */
.halloween-theme {
    background-color: var(--charcoal);
}


/* ========================================
   Monster Visuals
   ======================================== */

/* ========================================
   Result Icons & Quick Quest End Styles
   ======================================== */
.result-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Quick Quest End Page Styles */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    justify-items: center;
}

.result-card {
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.result-card h3 {
    color: var(--copper);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-card .result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--copper);
}

.result-card p {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
}


.result-icon {
    margin-bottom: 1rem;
}


.recap-table-container {
    margin: 2rem 0;
    overflow-x: auto;
}

.recap-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--cream);
}

.recap-table th {
    background-color: var(--mist);
    color: var(--cream);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--charcoal);
}

.recap-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--smoke);
    background-color: var(--charcoal);
    color: var(--cream);
    text-align: center;
}

.correct-row td:last-child,
.incorrect-row td:last-child {
    background-color: var(--charcoal);
    color: var(--cream);
}


.correct-result {
    background-color: var(--orange);
    color: var(--cream);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    margin: 0 auto;
}

.incorrect-result {
    background-color: var(--brew);
    color: var(--cream);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    margin: 0 auto;
}

.next-steps {
    background-color: var(--charcoal);
    padding: 2rem 0;
}

.next-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.action-card {
    background-color: var(--biscuit);
    border: 2px solid var(--mist);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.action-card:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.action-card p {
    color: var(--charcoal);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    flex-grow: 1;
}

.action-card .mode-button {
    background-color: var(--mist);
    color: var(--cream);
    margin-top: auto;
}

.action-card .mode-button:hover {
    background-color: var(--brew);
    transform: translateY(-2px);
}

/* ========================================
   Battle Area & Game Layout
   ======================================== */
.current-battle {
    background-color: var(--charcoal);
    padding: 2rem 0;
}

.battle-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: nowrap;
}

.monster-section {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.hacks-section {
    flex: 0 0 auto;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.hacks-container {
    background-color: var(--mist);
    border: 3px solid var(--orange);
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 1.5rem;
}

#monster-tooltip-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 200px;
    min-height: 200px;
    background-color: var(--brew);
    border: 3px solid var(--orange);
    border-radius: 15px;
    padding: 1rem;
    overflow: hidden;
    align-self: center;
}

.round-info {
    text-align: center;
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-info h3 {
    color: var(--copper);
    font-size: 1.2rem;
    margin: 0;
    text-align: center;
    width: 100%;
    display: block;
}

/* ========================================
   Unified Card System
   ======================================== */
.inner-card {
    width: 150px;
    height: 200px;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.monster-inner-card {
    background-color: var(--brew);
    border-radius: 15px;
}

.hack-card.visual {
    background-color: transparent;
    border: 2px solid var(--mist);
    border-radius: 8px;
    color: var(--charcoal);
}

.hack-card.selected {
    border: 3px solid var(--copper);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.3);
}

/* ========================================
   Demo Game Images
   ======================================== */
img[src*="gallery"],
.monster-visual,
.hack-card img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    cursor: help;
    border-radius: 10px;
    animation: none; /* No animation for gallery images */
}

/* ========================================
   Tooltip System - Consolidated Styles
   ======================================== */
body .tooltiptext {
    position: fixed;
    z-index: 9999999;
    background-color: transparent;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
    transform: none;
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.1;
    opacity: 0.75;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 200px;
    height: 200px;
    min-width: 120px;
    min-height: 120px;
    max-width: 250px;
    max-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip type-specific styles */
body .tooltiptext.monster-tooltip-body {
    background-image: url('/static/visual/demo-game/ghost.png');
    color: var(--charcoal);
    padding: 70px 63px 10px 63px;
    font-size: 11.5px;
}

body .tooltiptext.strategic-tooltip-body,
body .tooltiptext.submit-tooltip-body {
    background-image: url('/static/visual/demo-game/bat2.png');
    color: var(--cream);
    padding: 100px 40px 10px 40px;
    font-size: 11.5px;
}

body .tooltiptext.submit-tooltip-body {
    background-image: url('/static/visual/demo-game/bat.png');
}

body .tooltiptext.hack-tooltip {
    background-image: url('/static/visual/demo-game/pumpkin.png');
    color: var(--charcoal);
    padding: 100px 40px 10px 40px;
    font-size: 11.5px;
}

/* ========================================
   Strategic Button
   ======================================== */
#strategic-button {
    background-color: rgba(94, 53, 94, 0.75); /* 75% transparency of --mist */
    color: var(--cream);
    cursor: not-allowed;
    pointer-events: auto; /* Allow hover for tooltip */
    border: none;
    box-shadow: none;
    opacity: 1; /* Remove additional opacity to maintain 75% transparency */
    position: relative;
}

/* ========================================
   Hack Selection Styles
   ======================================== */
.hack-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   Quest Hero Styling
   ======================================== */
.quest-hero {
    background-color: var(--charcoal);
    padding: 2rem 0 1rem 0;
}

.quest-header {
    text-align: center;
    padding: 0;
}

.quest-title {
    color: var(--copper);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.quest-subtitle {
    color: var(--cream);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.quest-header .progress-text {
    color: var(--cream);
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   Feedback Section
   ======================================== */
.feedback-section {
    padding-top: 0;
}

.answer-feedback {
    margin-top: 1rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(-10px);
    display: none;
    position: relative;
    z-index: 10;
}

.answer-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.answer-feedback.correct {
    background-color: var(--orange);
    color: var(--cream);
    border: 2px solid var(--orange);
    box-shadow: 0 4px 15px rgba(204, 85, 0, 0.3);
}

.answer-feedback.incorrect {
    background-color: var(--brew);
    color: var(--cream);
    border: 2px solid var(--brew);
    box-shadow: 0 4px 15px rgba(85, 107, 47, 0.3);
}

/* ========================================
   Quick Quest End Specific Overrides
   ======================================== */
.section-title {
    font-size: 1.5rem;
}

.results-summary {
    padding-bottom: 0;
}

.battle-recap {
    padding-bottom: 0;
}

/* ========================================
   Footer Styling
   ======================================== */
.main-footer {
    background-color: var(--orange);
    color: var(--cream);
    padding: 20px 0;
    border-top: 1px solid var(--charcoal);
    text-align: center;
}

.main-footer a {
    color: var(--brew);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.main-footer a:hover {
    color: var(--mist);
}

/* ========================================
   Responsive Design - Standardized Breakpoints
   ======================================== */

/* Large screens (1200px and below) */
@media (max-width: 1200px) {
    .inner-card {
        width: 150px;
        height: 150px;
    }
    
    #monster-tooltip-container {
        width: 200px;
        min-height: 200px;
    }
}

/* Medium screens (768px and below) */
@media (max-width: 768px) {
    /* Mobile header positioning inherited from common.css */
    
    .game-modes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mode-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    img[src*="gallery"],
    .monster-visual,
    .hack-card img {
        width: 120px;
        height: 120px;
    }
    
    .inner-card {
        width: 120px;
        height: 120px;
    }
    
    body .tooltiptext {
        width: 150px;
        height: 150px;
        font-size: 10px;
    }
    
    body .tooltiptext.monster-tooltip-body {
        font-size: 8px;
        padding: 50px 46px 8px 46px;
    }
    
    body .tooltiptext.strategic-tooltip-body,
    body .tooltiptext.submit-tooltip-body,
    body .tooltiptext.hack-tooltip {
        font-size: 9px;
        padding: 70px 35px 8px 35px;
    }
    
    .answer-feedback {
        margin-bottom: 1.5rem;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .game-mode-card {
        padding: 1.5rem;
    }
    
    /* Quick Quest End responsive styles */
    .next-actions {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Battle area responsive behavior */
    .battle-area {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
        min-height: auto;
    }
    
    .monster-section {
        order: 1;
        width: 100%;
        align-items: center;
        flex: 1 1 100%;
        min-height: auto;
    }
    
    .hacks-section {
        order: 2;
        width: 100%;
        align-items: center;
        align-self: center;
        flex: 1 1 100%;
        min-height: auto;
    }
}

/* Small screens (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .game-mode-card {
        padding: 1.5rem;
    }
    
    img[src*="gallery"],
    .monster-visual,
    .hack-card img {
        width: 100px;
        height: 100px;
    }
    
    .inner-card {
        width: 100px;
        height: 100px;
    }
    
    body .tooltiptext {
        width: 120px;
        height: 120px;
        font-size: 9px;
    }
    
    body .tooltiptext.monster-tooltip-body {
        font-size: 7px;
        padding: 35px 35px 6px 35px;
    }
    
    body .tooltiptext.strategic-tooltip-body,
    body .tooltiptext.submit-tooltip-body,
    body .tooltiptext.hack-tooltip {
        font-size: 8px;
        padding: 50px 30px 6px 30px;
    }
    
    .answer-feedback {
        margin-bottom: 2rem;
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }
}
