/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #7b2cbf;
    --accent-light: #9d4edd;
    --positive-color: #10b981;
    --neutral-color: #f59e0b;
    --negative-color: #ef4444;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --black: #000000;
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--white);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--black);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid var(--white);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--white);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(123, 44, 191, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(157, 78, 221, 0.1) 0%, transparent 50%);
    z-index: -1;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 50px;
}

/* ===== Magic 8 Ball Game ===== */
.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.magic-8-ball {
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.magic-8-ball:hover {
    transform: scale(1.02);
}

.magic-8-ball.shaking {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    10% { transform: rotate(-10deg) translateX(-10px); }
    20% { transform: rotate(10deg) translateX(10px); }
    30% { transform: rotate(-10deg) translateX(-10px); }
    40% { transform: rotate(10deg) translateX(10px); }
    50% { transform: rotate(-5deg) translateX(-5px); }
    60% { transform: rotate(5deg) translateX(5px); }
    70% { transform: rotate(-3deg) translateX(-3px); }
    80% { transform: rotate(3deg) translateX(3px); }
    90% { transform: rotate(-1deg) translateX(-1px); }
}

.ball-outer {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a4a4a 0%, #1a1a1a 50%, #000 100%);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 -10px 30px rgba(0, 0, 0, 0.5),
        inset 0 10px 30px rgba(255, 255, 255, 0.1);
}

.ball-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 5px 20px rgba(0, 0, 0, 0.8);
}

.ball-window {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(180deg, #0a1628 0%, #1a3a5c 50%, #0a1628 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.triangle {
    width: 0;
    height: 0;
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 78px solid #1e40af;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.triangle span {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    width: 70px;
    line-height: 1.2;
    text-transform: uppercase;
}

.triangle.fade-out {
    opacity: 0;
    transform: scale(0.8);
}

.triangle.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.ball-shine {
    position: absolute;
    top: 15px;
    left: 25px;
    width: 80px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Question Box */
.question-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.question-label {
    font-size: 1rem;
    color: var(--text-muted);
}

.question-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: var(--transition);
}

.question-input:focus {
    outline: none;
    border-color: var(--accent-light);
    background: rgba(255, 255, 255, 0.08);
}

.question-input::placeholder {
    color: var(--text-muted);
}

.ask-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: var(--gradient-purple);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
}

.ask-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.ask-button:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.instruction {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ===== Sections ===== */
.section {
    padding: 80px 0;
}

.section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 20px;
    color: var(--white);
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ===== Answers Section ===== */
.answers-section {
    background: var(--secondary-color);
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.answer-category {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.answer-category:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.answer-category h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.answer-category.positive h3 { color: var(--positive-color); }
.answer-category.neutral h3 { color: var(--neutral-color); }
.answer-category.negative h3 { color: var(--negative-color); }

.category-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.answer-category ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-category li {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.answer-category.positive li:hover { background: rgba(16, 185, 129, 0.2); }
.answer-category.neutral li:hover { background: rgba(245, 158, 11, 0.2); }
.answer-category.negative li:hover { background: rgba(239, 68, 68, 0.2); }

/* ===== Questions Section ===== */
.questions-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.tab-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.tab-btn.active {
    background: var(--gradient-purple);
    border-color: transparent;
    color: var(--white);
}

.tab-content {
    display: none;
    max-width: 600px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-content h3 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--accent-light);
}

.questions-list {
    display: grid;
    gap: 12px;
}

.questions-list li {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.questions-list li:hover {
    background: rgba(123, 44, 191, 0.2);
    border-color: var(--accent-light);
    transform: translateX(5px);
}

/* ===== History Section ===== */
.history-section {
    background: var(--secondary-color);
}

.history-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 50px;
    align-items: start;
}

.history-text h3 {
    color: var(--accent-light);
    margin: 30px 0 15px;
    font-size: 1.4rem;
}

.history-text h3:first-child {
    margin-top: 0;
}

.history-text p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.history-timeline {
    margin: 20px 0;
    padding-left: 20px;
}

.history-timeline li {
    position: relative;
    padding: 10px 0 10px 25px;
    border-left: 2px solid var(--accent-color);
}

.history-timeline li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 15px;
    width: 10px;
    height: 10px;
    background: var(--accent-light);
    border-radius: 50%;
}

.timeline-visual {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item .year {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-light);
}

.timeline-item .event {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.timeline-item.active {
    background: rgba(123, 44, 191, 0.2);
    margin: 0 -30px;
    padding: 15px 30px;
    border-radius: var(--border-radius);
}

.timeline-item.active .year {
    color: var(--white);
}

/* ===== How It Works Section ===== */
.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.how-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
}

.how-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-light);
}

.how-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.how-card h3 {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.how-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.probability-box {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 30px;
}

.probability-box h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--white);
}

.probability-box > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.probability-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prob-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.prob-label {
    width: 120px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.prob-bar {
    height: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--white);
    transition: var(--transition);
}

.prob-bar.positive { background: var(--positive-color); }
.prob-bar.neutral { background: var(--neutral-color); }
.prob-bar.negative { background: var(--negative-color); }

/* ===== FAQ Section ===== */
.faq-section {
    background: var(--secondary-color);
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--accent-light);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent-light);
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-bottom: 20px;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
    background: var(--black);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-brand p {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.8rem !important;
    opacity: 0.7;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    .history-content {
        grid-template-columns: 1fr;
    }

    .timeline-visual {
        max-width: 400px;
        margin: 0 auto;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary-color);
        flex-direction: column;
        align-items: center;
        padding: 30px;
        gap: 20px;
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }

    .ball-outer {
        width: 240px;
        height: 240px;
    }

    .ball-inner {
        width: 120px;
        height: 120px;
    }

    .ball-window {
        width: 95px;
        height: 95px;
    }

    .triangle {
        border-left: 38px solid transparent;
        border-right: 38px solid transparent;
        border-bottom: 66px solid #1e40af;
    }

    .triangle span {
        font-size: 0.6rem;
        width: 60px;
        top: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-brand .logo {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 15px 40px;
    }

    .ball-outer {
        width: 200px;
        height: 200px;
    }

    .ball-inner {
        width: 100px;
        height: 100px;
    }

    .ball-window {
        width: 80px;
        height: 80px;
    }

    .triangle {
        border-left: 32px solid transparent;
        border-right: 32px solid transparent;
        border-bottom: 55px solid #1e40af;
    }

    .triangle span {
        font-size: 0.5rem;
        width: 50px;
        top: 16px;
    }

    .question-box {
        padding: 0 10px;
    }

    .ask-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .section {
        padding: 50px 0;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .questions-tabs {
        gap: 8px;
    }

    .tab-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}
