/* Al-Qadim: The Genie's Curse Interactive Companion Guide Stylesheet */
/* Theme: Arabian Nights - deep midnight blue, navy, gold, sand, purple nebula */

:root {
    --aq-bg-dark: #0c0f1a;
    --aq-bg-mid: #151b30;
    --aq-bg-card: #1c2545;
    --aq-text: #f0e6d3;
    --aq-text-muted: #a89b8c;
    --aq-accent-gold: #f5c842;
    --aq-accent-teal: #2dd4bf;
    --aq-accent-ruby: #e63946;
    --aq-accent-purple: #9f7aea;
    --aq-accent-sand: #d4a76a;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--aq-bg-dark);
    color: var(--aq-text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Nebula background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(245, 200, 66, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, rgba(159, 122, 234, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Floating warm sand particles / stars */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(1px 1px at 40px 50px, rgba(245, 200, 66, 0.35), transparent),
        radial-gradient(1px 1px at 80px 140px, rgba(212, 167, 106, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 120px 240px, rgba(245, 200, 66, 0.5), transparent),
        radial-gradient(1px 1px at 180px 90px, rgba(159, 122, 234, 0.3), transparent),
        radial-gradient(1px 1px at 240px 180px, rgba(245, 200, 66, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 280px 320px, rgba(212, 167, 106, 0.45), transparent),
        radial-gradient(1px 1px at 320px 80px, rgba(245, 200, 66, 0.3), transparent),
        radial-gradient(1px 1px at 360px 210px, rgba(159, 122, 234, 0.35), transparent);
    background-size: 500px 350px;
    animation: floatSand 90s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
}

@keyframes floatSand {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-350px);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, serif;
    color: var(--aq-text);
}

.text-gradient {
    background: linear-gradient(135deg, var(--aq-accent-gold) 30%, var(--aq-accent-sand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header styling */
.aq-header {
    background: linear-gradient(to bottom, rgba(21, 27, 48, 0.85), rgba(12, 15, 26, 0));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(245, 200, 66, 0.15);
    position: relative;
    z-index: 10;
}

.aq-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-shadow: 0 4px 12px rgba(245, 200, 66, 0.25);
    text-transform: uppercase;
}

.aq-subtitle {
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: var(--aq-text-muted);
}

/* Tab Navigation buttons */
.nav-button {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    background: rgba(28, 37, 69, 0.4);
    border: 1px solid rgba(245, 200, 66, 0.2);
    border-radius: 4px;
    color: var(--aq-text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-button:hover {
    color: var(--aq-accent-gold);
    border-color: var(--aq-accent-gold);
    background: rgba(28, 37, 69, 0.7);
    box-shadow: 0 0 10px rgba(245, 200, 66, 0.15);
}

.nav-button.active {
    color: var(--aq-accent-gold);
    border-color: var(--aq-accent-gold);
    background: var(--aq-bg-card);
    box-shadow: 0 0 15px rgba(245, 200, 66, 0.3);
}

/* Cards & Panels */
.aq-card {
    background: rgba(28, 37, 69, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 167, 106, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.aq-card:hover {
    border-color: rgba(245, 200, 66, 0.35);
    box-shadow: 0 8px 32px rgba(245, 200, 66, 0.08), 0 0 15px rgba(245, 200, 66, 0.1);
}

/* Dynamic Art toggle modes styles */
.art-mode-switch {
    display: flex;
    background: rgba(12, 15, 26, 0.6);
    border: 1px solid rgba(245, 200, 66, 0.25);
    border-radius: 20px;
    padding: 2px;
    overflow: hidden;
}

.art-mode-switch button {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 18px;
    transition: all 0.25s ease;
}

.art-mode-switch button.active {
    background: var(--aq-accent-gold);
    color: var(--aq-bg-dark);
    box-shadow: 0 2px 6px rgba(245, 200, 66, 0.4);
}

/* Interactive Walkthrough Chapter Accordion */
.chapter-header {
    background: rgba(21, 27, 48, 0.75);
    border: 1px solid rgba(212, 167, 106, 0.12);
    transition: all 0.2s ease;
}

.chapter-header:hover {
    background: rgba(28, 37, 69, 0.85);
    border-color: rgba(245, 200, 66, 0.3);
}

.chapter-header.active {
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.chapter-content {
    background: rgba(12, 15, 26, 0.4);
    border: 1px solid rgba(212, 167, 106, 0.12);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.checkbox-custom {
    position: relative;
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--aq-accent-sand);
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease;
}

.checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -3px;
    left: 1px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--aq-accent-gold);
    opacity: 0;
    transition: opacity 0.2s ease;
}

input[type="checkbox"]:checked + .checkbox-custom {
    border-color: var(--aq-accent-gold);
    background: rgba(245, 200, 66, 0.1);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
}

/* Custom Alert / Warning Boxes */
.warning-box {
    background: rgba(230, 57, 70, 0.1);
    border-left: 4px solid var(--aq-accent-ruby);
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.warning-box-title {
    font-weight: 700;
    color: var(--aq-accent-ruby);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.info-box {
    background: rgba(45, 212, 191, 0.1);
    border-left: 4px solid var(--aq-accent-teal);
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.info-box-title {
    font-weight: 700;
    color: var(--aq-accent-teal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.gold-box {
    background: rgba(245, 200, 66, 0.07);
    border: 1px solid rgba(245, 200, 66, 0.25);
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

/* AI Panel Interface */
.walkthrough-ai {
    height: calc(100vh - 200px);
    max-height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(159, 122, 234, 0.25);
    box-shadow: 0 0 20px rgba(159, 122, 234, 0.05);
}

.walkthrough-ai:focus-within {
    border-color: var(--aq-accent-purple);
    box-shadow: 0 0 25px rgba(159, 122, 234, 0.15);
}

.walkthrough-ai-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(159, 122, 234, 0.2) transparent;
}

.walkthrough-ai-body::-webkit-scrollbar {
    width: 6px;
}

.walkthrough-ai-body::-webkit-scrollbar-thumb {
    background-color: rgba(159, 122, 234, 0.2);
    border-radius: 3px;
}

.message {
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: rgba(159, 122, 234, 0.15);
    border: 1px solid rgba(159, 122, 234, 0.25);
    color: var(--aq-text);
}

.message.ai {
    align-self: flex-start;
    background: rgba(28, 37, 69, 0.85);
    border: 1px solid rgba(245, 200, 66, 0.15);
    color: var(--aq-text);
}

.walkthrough-ai-input {
    display: flex;
    background: rgba(12, 15, 26, 0.8);
    border-top: 1px solid rgba(159, 122, 234, 0.2);
    padding: 0.75rem;
    gap: 0.5rem;
}

.walkthrough-ai-text {
    flex: 1;
    background: rgba(28, 37, 69, 0.5);
    border: 1px solid rgba(212, 167, 106, 0.25);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--aq-text);
    font-size: 0.875rem;
}

.walkthrough-ai-text:focus {
    outline: none;
    border-color: var(--aq-accent-gold);
    box-shadow: 0 0 8px rgba(245, 200, 66, 0.15);
}

.walkthrough-ai-send {
    background: var(--aq-bg-card);
    border: 1px solid var(--aq-accent-gold);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: var(--aq-accent-gold);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.walkthrough-ai-send:hover {
    background: var(--aq-accent-gold);
    color: var(--aq-bg-dark);
    box-shadow: 0 0 10px rgba(245, 200, 66, 0.3);
}

.walkthrough-ai-clear {
    font-size: 0.75rem;
    color: var(--aq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.walkthrough-ai-clear:hover {
    color: var(--aq-accent-ruby);
}

/* Tables */
.aq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.aq-table th {
    font-family: 'Lora', Georgia, serif;
    background: rgba(12, 15, 26, 0.6);
    border-bottom: 2px solid rgba(212, 167, 106, 0.25);
    color: var(--aq-accent-gold);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
}

.aq-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(212, 167, 106, 0.12);
}

.aq-table tr:hover {
    background: rgba(28, 37, 69, 0.35);
}

/* Active tab hide/show */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Map interactive highlights & annotations */
.atlas-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .atlas-container {
        grid-template-columns: 3fr 2fr;
    }
}

.map-viewer-wrapper {
    position: relative;
    border: 2px solid rgba(212, 167, 106, 0.3);
    border-radius: 8px;
    background: #000;
    overflow: hidden;
}

.map-view-image {
    width: 100%;
    height: auto;
    display: block;
}

.annotation-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.annotation-item:hover {
    background: rgba(245, 200, 66, 0.05);
    border-left-color: var(--aq-accent-gold);
}

.annotation-item.active {
    background: rgba(245, 200, 66, 0.1);
    border-left-color: var(--aq-accent-gold);
}

/* Scrollable panels */
.scroll-panel {
    max-height: 600px;
    overflow-y: auto;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--aq-accent-purple);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Character Move cards */
.move-card {
    border-left: 4px solid var(--aq-accent-gold);
}

.move-card.hack { border-left-color: var(--aq-accent-teal); }
.move-card.sweep { border-left-color: var(--aq-accent-ruby); }
.move-card.twirling { border-left-color: var(--aq-accent-purple); }

/* Guess the Number Gambling Widget */
.calc-input {
    background: rgba(12, 15, 26, 0.7);
    border: 1px solid rgba(212, 167, 106, 0.3);
    border-radius: 4px;
    color: var(--aq-text);
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    width: 100%;
}

.calc-input:focus {
    outline: none;
    border-color: var(--aq-accent-gold);
}

.calc-btn {
    background: rgba(245, 200, 66, 0.1);
    border: 1px solid var(--aq-accent-gold);
    color: var(--aq-accent-gold);
    font-weight: 600;
    transition: all 0.2s ease;
}

.calc-btn:hover {
    background: var(--aq-accent-gold);
    color: var(--aq-bg-dark);
}
