/* ══════════════════════════════════════
   NUJUM Web App - Stylesheet
   Primbon Betaljemur Adammakna
   ══════════════════════════════════════ */

:root {
    /* Colors - matching Android app */
    --nujum-background: #0D0D14;
    --nujum-surface: #1A1B23;
    --nujum-primary: #0288D1;
    --nujum-secondary: #00BFA5;
    --nujum-on-background: #E8E8E8;
    --nujum-on-surface-variant: #B8B8B8;
    --gradient-start: #0288D1;
    --gradient-end: #00BFA5;
    --gold-accent: #FFD700;
    --spectrum-baik: #4CAF50;
    --spectrum-bersyarat: #FF9800;
    --spectrum-kurang-baik: #F44336;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-javanese: 'Noto Sans Javanese', serif;
}

/* ══════════════════════════════════════
   Reset & Base
   ══════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--nujum-background);
    color: var(--nujum-on-background);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ══════════════════════════════════════
   Language Toggle
   ══════════════════════════════════════ */
.lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: rgba(0, 0, 0, 0.45);
    transform: scale(1.05);
}

.lang-toggle .flag {
    font-size: 16px;
}

.lang-toggle .lang-code {
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   Header
   ══════════════════════════════════════ */
.header {
    position: relative;
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%230d0d14" fill-opacity="0.3" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom center no-repeat;
    background-size: cover;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(13, 13, 20, 0.6));
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
}

.app-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(2, 136, 209, 0.3);
    letter-spacing: 4px;
}

.app-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   Container
   ══════════════════════════════════════ */
.container {
    max-width: 1200px;
    margin: -60px auto 0;
    padding: 0 20px 40px;
    position: relative;
    z-index: 2;
}

/* ══════════════════════════════════════
   Cards
   ══════════════════════════════════════ */
.card {
    background: var(--nujum-surface);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(2, 136, 209, 0.2);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--nujum-on-surface-variant);
    opacity: 0.85;
}

/* ══════════════════════════════════════
   Categories Grid
   ══════════════════════════════════════ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.category-item {
    background: linear-gradient(135deg, rgba(2, 136, 209, 0.1), rgba(0, 191, 165, 0.05));
    border: 1px solid rgba(2, 136, 209, 0.2);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(2, 136, 209, 0.2), rgba(0, 191, 165, 0.1));
    border-color: var(--nujum-primary);
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3);
}

.category-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 2px 10px rgba(2, 136, 209, 0.4);
}

.category-label {
    font-size: 0.85rem;
    color: var(--nujum-on-background);
    font-weight: 500;
    line-height: 1.3;
}

/* Expand Button */
.btn-expand {
    width: 100%;
    padding: 12px;
    background: rgba(2, 136, 209, 0.1);
    border: 1px solid rgba(2, 136, 209, 0.3);
    border-radius: 12px;
    color: var(--nujum-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-expand:hover {
    background: rgba(2, 136, 209, 0.2);
    transform: scale(1.02);
}

.btn-expand.collapsed::before {
    content: '▼';
    margin-right: 4px;
}

.btn-expand.expanded::before {
    content: '▲';
    margin-right: 4px;
}

/* ══════════════════════════════════════
   Questions List
   ══════════════════════════════════════ */
.questions-list {
    margin-top: 20px;
}

.question-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 215, 0, 0.05);
    border-left: 3px solid var(--gold-accent);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(4px);
}

.question-number {
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--gold-accent);
    font-weight: 600;
}

.question-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--nujum-on-background);
}

/* ══════════════════════════════════════
   Buttons
   ══════════════════════════════════════ */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 136, 209, 0.5);
}

.btn-share {
    flex: 1;
    padding: 14px 24px;
    background: rgba(26, 35, 126, 0.8);
    border: 1px solid rgba(2, 136, 209, 0.3);
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-share:hover {
    background: rgba(26, 35, 126, 1);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════
   Modals
   ══════════════════════════════════════ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.modal-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.modal-content {
    position: relative;
    background: var(--nujum-surface);
    border-radius: 20px;
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--nujum-primary);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--nujum-on-surface-variant);
    margin-bottom: 20px;
}

/* Form Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--nujum-on-background);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(2, 136, 209, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--nujum-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

.btn-submit {
    margin-top: 20px;
}

/* ══════════════════════════════════════
   Ritual Animation
   ══════════════════════════════════════ */
.ritual-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ritual-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.ritual-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(2, 136, 209, 0.2), rgba(0, 191, 165, 0.2));
    border: 2px solid var(--nujum-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(2, 136, 209, 0.5), inset 0 0 40px rgba(2, 136, 209, 0.2);
    animation: ritualPulse 2s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes ritualPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(2, 136, 209, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(2, 136, 209, 0.8); }
}

.ritual-letter {
    font-family: var(--font-javanese);
    font-size: 80px;
    color: white;
    animation: ritualSpin 3s linear infinite;
}

@keyframes ritualSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ritual-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-style: italic;
    padding: 0 40px;
    animation: ritualFade 2s ease-in-out infinite;
}

@keyframes ritualFade {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ══════════════════════════════════════
   Result Modal
   ══════════════════════════════════════ */
.modal-result {
    max-width: 600px;
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-category {
    font-size: 1rem;
    color: rgba(144, 202, 249, 0.9);
    margin-bottom: 6px;
}

.result-question {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.result-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.spectrum-badge {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid;
}

.spectrum-baik {
    background: rgba(76, 175, 80, 0.15);
    color: var(--spectrum-baik);
    border-color: rgba(76, 175, 80, 0.3);
}

.spectrum-bersyarat {
    background: rgba(255, 152, 0, 0.15);
    color: var(--spectrum-bersyarat);
    border-color: rgba(255, 152, 0, 0.3);
}

.spectrum-kurang-baik {
    background: rgba(244, 67, 54, 0.15);
    color: var(--spectrum-kurang-baik);
    border-color: rgba(244, 67, 54, 0.3);
}

.letter-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    border: 1px solid rgba(2, 136, 209, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-javanese);
    font-size: 20px;
    color: white;
}

.result-answer-card {
    position: relative;
    background: var(--nujum-background);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.answer-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to bottom, var(--gradient-start), var(--gradient-end));
    border-radius: 16px 0 0 16px;
}

.result-answer {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--nujum-on-background);
    font-weight: 500;
    padding-left: 16px;
}

.result-expiry {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--nujum-on-surface-variant);
    font-style: italic;
    margin-bottom: 20px;
    justify-content: center;
}

.result-actions {
    display: flex;
    gap: 12px;
}

/* ══════════════════════════════════════
   Footer
   ══════════════════════════════════════ */
.footer-card {
    background: var(--nujum-surface);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.footer-divider {
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    margin: 0 auto 16px;
}

.footer-source {
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.75);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.footer-tagline {
    font-size: 0.8rem;
    color: rgba(184, 184, 184, 0.5);
    margin-bottom: 16px;
}

.footer-hr {
    border: none;
    height: 1px;
    background: rgba(232, 232, 232, 0.07);
    margin: 16px 0 12px;
}

.footer-credit {
    font-size: 0.85rem;
    color: rgba(184, 184, 184, 0.55);
    margin-bottom: 4px;
}

.footer-link a {
    color: var(--nujum-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-link a:hover {
    color: var(--gradient-end);
    text-decoration: underline;
}

/* Ad Placeholder */
.ad-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin: 24px 0;
}

.ad-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ══════════════════════════════════════
   Utility Classes
   ══════════════════════════════════════ */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .app-title {
        font-size: 2.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ritual-circle {
        width: 160px;
        height: 160px;
    }

    .ritual-letter {
        font-size: 60px;
    }
}

