/**
 * Advanced PHP Mobile Numerology Analysis System
 * Design Theme: "Artistic Flair"
 * Palette: Rich Indigo (#0b2b5c), Burnt Amber / Terracotta (#b45f2b), Warm Canvas (#fef9f0)
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800&family=Hind+Siliguri:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-canvas: #fef9f0;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --bg-surface-elevated: #ffffff;
    --bg-tint-warm: #fcf5eb;
    --bg-tint-soft: #f6ecdf;
    
    --primary-blue: #0b2b5c;
    --primary-blue-light: #18427e;
    --primary-amber: #b45f2b;
    --primary-amber-light: #c86d38;
    --accent-gold: #d97706;
    --accent-gold-soft: #fef3c7;
    
    --text-main: #1d1829;
    --text-muted: #6b5f54;
    --text-light: #948677;
    
    --border-warm: rgba(212, 193, 172, 0.65);
    --border-focus: #b45f2b;
    
    --success: #15803d;
    --success-bg: #f0fdf4;
    --success-border: #86efac;
    
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fca5a5;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 6px rgba(75, 45, 20, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(75, 45, 20, 0.07);
    --shadow-lg: 0 16px 36px -6px rgba(75, 45, 20, 0.1);
    --shadow-glow: 0 0 25px rgba(180, 95, 43, 0.2);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hind Siliguri', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-canvas);
    background-image: 
        radial-gradient(at 0% 0%, rgba(180, 95, 43, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(11, 43, 92, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(217, 119, 6, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Enhancements */
h1, h2, h3, h4, .cinzel-font {
    font-family: 'Hind Siliguri', 'Cinzel', 'Plus Jakarta Sans', serif;
    letter-spacing: -0.01em;
}

/* Header / Top Bar */
.top-bar {
    background: rgba(11, 43, 92, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(11, 43, 92, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-brand {
    font-family: 'Hind Siliguri', 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.top-bar-brand span.sparkle {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(254, 240, 138, 0.6));
}

.top-bar-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.token-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(6px);
}

.token-pill strong {
    color: #fef08a;
    font-weight: 700;
}

.btn-top-logout {
    background: rgba(180, 95, 43, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-top-logout:hover {
    background: var(--primary-amber);
    box-shadow: 0 0 12px rgba(180, 95, 43, 0.4);
    transform: translateY(-1px);
}

/* Main Container Layout */
.main-container {
    flex: 1;
    max-width: 1060px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 20px 60px 20px;
}

/* Glass & Artistic Cards */
.card, .glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-warm);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 26px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    border-bottom: 1.5px solid var(--border-warm);
    padding-bottom: 14px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fbf0e4;
    color: var(--primary-amber);
    font-size: 1.15rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2b2438;
    font-size: 0.98rem;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #d8c7b4;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    background: #ffffff;
    color: #1e1a2f;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-input:focus {
    border-color: var(--primary-amber);
    box-shadow: 0 0 0 4px rgba(180, 95, 43, 0.18), inset 0 1px 2px rgba(0,0,0,0.02);
    background: #fffdfa;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 7px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-md);
    font-size: 1.02rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #0b2b5c 0%, #1e457e 45%, #b45f2b 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(11, 43, 92, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(180, 95, 43, 0.3);
    filter: brightness(1.04);
}

.btn-secondary {
    background: #f6ebd9;
    color: var(--primary-blue);
    border: 1.5px solid #dfcdba;
}

.btn-secondary:hover {
    background: #eedbc2;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* Alert Boxes */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    font-size: 0.96rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-box {
    background: #fdf8f0;
    border: 1.5px solid #ecdac6;
    border-radius: var(--radius-md);
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.summary-box:hover {
    transform: translateY(-2px);
    border-color: var(--primary-amber);
}

.summary-box-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.summary-box-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.summary-box-sub {
    font-size: 0.82rem;
    color: #7d7060;
    margin-top: 4px;
}

/* Score Section - Artistic Flair Hero */
.score-hero {
    background: linear-gradient(135deg, #0b2b5c 0%, #173d74 45%, #b45f2b 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 38px 24px;
    text-align: center;
    margin-bottom: 28px;
    box-shadow: 0 14px 34px rgba(11, 43, 92, 0.25);
    position: relative;
    overflow: hidden;
}

.score-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(254, 240, 138, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 5px solid #fde68a;
    box-shadow: 0 0 25px rgba(253, 230, 138, 0.25), inset 0 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
    position: relative;
    backdrop-filter: blur(8px);
}

.score-number {
    font-size: 3.2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.score-max {
    font-size: 0.95rem;
    color: #fef08a;
    font-weight: 700;
    margin-top: 2px;
}

.score-category-text {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fef08a;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.score-desc-text {
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0 auto;
    opacity: 0.96;
    line-height: 1.55;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-excellent {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.badge-good {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.badge-average {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-warning {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.badge-challenge {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 14px;
}

.table-custom th {
    background: #f5eae0;
    color: #2b223c;
    padding: 13px 16px;
    font-weight: 700;
    text-align: left;
    font-size: 0.92rem;
    border-bottom: 2px solid #decbbe;
}

.table-custom th:first-child {
    border-top-left-radius: var(--radius-sm);
}

.table-custom th:last-child {
    border-top-right-radius: var(--radius-sm);
}

.table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee0d2;
    font-size: 0.94rem;
    vertical-align: top;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tr:hover td {
    background: #fdfaf6;
}

/* Pair Card Grid */
.pair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.pair-card {
    background: #fffdfa;
    border: 1.5px solid #ecd8c2;
    border-radius: var(--radius-md);
    padding: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pair-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-amber);
}

.pair-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0e3d3;
}

.pair-badge-num {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-blue);
    background: #eef3fb;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #c7d8f2;
}

.pair-card-title {
    font-weight: 700;
    color: #231c36;
    font-size: 0.98rem;
}

/* Recommendations Layout */
.rec-box {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.rec-box-p1 {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}

.rec-box-p2 {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
}

.rec-box-avoid {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
}

.root-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.root-pill {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.root-pill:hover {
    transform: scale(1.1);
}

.root-pill-p1 { background: #15803d; color: white; border: 2px solid #86efac; }
.root-pill-p2 { background: #2563eb; color: white; border: 2px solid #93c5fd; }
.root-pill-avoid { background: #b91c1c; color: white; border: 2px solid #fca5a5; }
.root-pill-neutral { background: #6b7280; color: white; border: 2px solid #d1d5db; }

/* Disclaimer Banner */
.disclaimer-box {
    background: #fbf3ea;
    border-left: 4px solid var(--primary-amber);
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: #4a3e31;
    margin-top: 32px;
    line-height: 1.65;
}

/* Animated Loading Screen */
.loading-overlay {
    text-align: center;
    padding: 55px 20px;
}

.loader-spinner {
    width: 68px;
    height: 68px;
    border: 6px solid #ecdac6;
    border-top: 6px solid var(--primary-amber);
    border-right: 6px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin: 0 auto 24px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-progress-bar {
    width: 100%;
    max-width: 480px;
    height: 10px;
    background: #eedcc9;
    border-radius: 20px;
    margin: 22px auto;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0b2b5c, #b45f2b);
    width: 0%;
    border-radius: 20px;
    transition: width 0.4s ease;
}

.loading-step-text {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--primary-blue);
    min-height: 32px;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 0.9rem;
    color: #796c5c;
    border-top: 1px solid #ebdccb;
    background: #fbf5eb;
    margin-top: auto;
}

/* Print Styles */
@media print {
    .top-bar, .btn, .no-print {
        display: none !important;
    }
    body {
        background: #ffffff;
        color: #000000;
    }
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* Responsive Rules */
@media (max-width: 768px) {
    .top-bar {
        padding: 12px 16px;
    }
    .main-container {
        padding: 20px 14px;
    }
    .card {
        padding: 20px 16px;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pair-grid {
        grid-template-columns: 1fr;
    }
}
