/* --- Theme Variables --- */
:root {
    touch-action: pan-y;
    /* Disables pinch-zoom and double-tap zoom, allows vertical scroll */
    /* Primary - 60% */
    /* Premium Gold/Bronze (Main Theme Color) */
    --primary-beige: #F8F3E9;
    /* Warm Cream (was #F4F1EA) */
    --bg-cream: #FFFBF2;
    /* Soft White/Cream (was #FDFBF7) */

    /* Secondary - 30% */
    --secondary-royal: #15192B;
    /* Deep Midnight Blue (was #2C2C54) */
    --secondary-olive: #556B2F;
    /* Nature/Balance */

    /* Accent - 10% */
    --accent-saffron: #E6B75A;
    /* Mustard Gold (was #F2CC8F) */
    --accent-ruby: #C62828;

    /* Neutrals */
    --text-dark: #2D2D2D;
    --text-muted: #666666;
    /* Slightly darker for better contrast (was #6D6875) */
    --white: #ffffff;
    --border-soft: #EAE2D6;
    --border-gold: 1px solid rgba(193, 154, 91, 0.2);

    /* Shadows & Radius */
    --card-shadow: 0 10px 30px rgba(21, 25, 43, 0.08);
    /* Soft/Dreamy with Blue tint */
    --radius-card: 24px;
    --radius-btn: 50px;

    /* Fonts */
    --font-heading: 'Poppins', 'Noto Sans Telugu', sans-serif;
    --font-body: 'Poppins', 'Noto Sans Telugu', sans-serif;
    --font-serif: 'Noto Serif Telugu', 'Ramabhadra', serif;
    --font-display: 'Ramabhadra', 'Noto Serif Telugu', serif;
    --font-accent: 'Playfair Display', 'Noto Serif Telugu', serif;

    /* Missing Variables Repair */
    --secondary-navy: #15192B;
    --primary-gold: #C19A5B;
    --accent-gold: #D4AF37;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f9a825;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-beige);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 16px;
    padding: 0;
    background-image: linear-gradient(180deg, #FDFBF7 0%, #F4F1EA 100%);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent horizontal scroll/zoom triggers */
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title,
.table th {
    font-family: var(--font-serif) !important;
    color: var(--secondary-royal);
    font-weight: 600;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Premium Telugu Typography */
html[lang="te"] h1,
html[lang="te"] h2,
html[lang="te"] h3,
html[lang="te"] h4,
html[lang="te"] h5,
html[lang="te"] h6,
html[lang="te"] .section-title,
html[lang="te"] .current-section-title {
    font-family: 'Noto Serif Telugu', serif !important;
    font-weight: 600;
}

/* English Serif Elegance */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] .section-title {
    font-family: 'Noto Serif Telugu', serif !important;
    font-weight: 600;
}

/* --- Layout --- */
.main-container {
    max-width: 100vw;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
}

/* --- Global Layout Spacing --- */
main#app-content {
    flex: 1;
    /* Pushes footer to bottom */
    padding-bottom: 2rem;
    /* Consistent buffer above footer/bottom-nav */
}

/* Exception for Compass page which manages its own height constraints */
body:has(#view-compass) main#app-content {
    padding-bottom: 0;
}

/* Specific button width for Alaya Calculator - prevent full-width on mobile */
#backToHome.back-btn {
    width: auto !important;
}

/* --- Layout Wrapper --- */
.content-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    /* Reduced from 1.25rem for mobile */
    display: inherit;
    flex-direction: inherit;
    justify-content: inherit;
    align-items: inherit;
    gap: inherit;
    height: inherit;
}

@media (min-width: 480px) {
    .content-wrapper {
        padding: 0 1.25rem;
    }
}

@media (min-width: 1024px) {
    .content-wrapper {
        max-width: 1200px;
        padding: 0 2rem;
    }
}

/* --- Component: App Header --- */
.app-header {
    background: #fffbf2;
    /* Crisper white bg */
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    /* Reduced for mobile */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    height: 64px;
    /* Reduced from 72px */
}

@media (min-width: 1024px) {
    .app-header {
        padding: 1.25rem 2rem;
        height: 72px;
    }
}

/* Ensure header content is centered via wrapper */
.app-header .content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    /* Match parent height */
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-container {
    height: 52px;
    width: 52px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid var(--primary-gold);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.app-logo {
    height: 100%;
    width: 100%;
    object-fit: contain;
    display: block;
}

.app-info h1 {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.1;
    color: var(--primary-gold);
    /* Saffron/Gold */
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

html[lang="en"] .app-info h1 {
    font-size: 1.5rem;
}

.app-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn,
.profile-btn {
    background: var(--white);
    border: 1px solid var(--border-soft);
    height: 40px;
    width: 40px;
    border-radius: 50%;
    color: var(--secondary-royal);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.icon-btn:hover,
.profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: var(--primary-gold);
}

/* --- View Management --- */
.view-section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-section.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--secondary-royal);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

/* Fixed size for Back Arrow button in section headers */
.section-header .back-btn {
    width: 66px !important;
    height: 46px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: white !important;
    border: 2px solid #eee !important;
    border-radius: 12px !important;
}

.section-header .back-btn i {
    font-size: 16px !important;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-back-home {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-decoration: none;
    background: white;
    color: #4a4a4a;
    border: 2px solid #e0e0e0;
}

.btn-back-home:hover {
    background: #f5f5f5;
    border-color: #4a4a4a;
}


/* --- Component: Hero Section --- */
.hero-section {
    margin-bottom: 2.5rem;
    text-align: left;
}

.hero-section h2 {
    font-size: 2rem;
    color: var(--secondary-royal);
    margin-bottom: 0.5rem;
}

.hero-section p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- Component: Action Grid --- */
.action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.action-card {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(44, 44, 84, 0.12);
    border-color: var(--accent-saffron);
}

.action-card.primary {
    background: linear-gradient(225deg, var(--white), #fffbf0);
    color: var(--secondary-royal);
}

.action-card .icon-box {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--primary-beige);
    color: var(--primary-gold);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.action-card.primary .icon-box {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.action-card .card-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    color: var(--secondary-royal);
}

.action-card.primary .card-text h3 {
    color: var(--white);
}

.action-card .card-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.action-card.primary .card-text p {
    color: rgba(255, 255, 255, 0.9);
}

.action-card .arrow {
    margin-left: auto;
    color: var(--primary-gold);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.action-card.primary .arrow {
    color: var(--white);
}

.action-card:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- Library Grid --- */
.library-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.library-card {
    background: linear-gradient(225deg, var(--white), #fffbf0);
    padding: 1.25rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.library-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-gold);
    box-shadow: 0 10px 25px rgba(224, 122, 95, 0.15);
}

.library-card i {
    font-size: 2rem;
    color: var(--primary-gold);
    margin-bottom: 0.75rem;
}

.library-card h4 {
    font-size: 0.95rem;
    color: var(--secondary-royal);
    margin: 0;
}

/* --- Content --- */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    background: linear-gradient(225deg, var(--white), #fffbf0);
    padding: 1.5rem;
    border-radius: var(--radius-card);
    border: var(--border-gold);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.panel h3 {
    font-size: 1.25rem;
    color: var(--primary-gold);
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
}

.results-heading {
    font-size: 1.5rem;
    color: var(--text-dark);
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Calculator Layout Styles */

/* Specific overrides for Calculator Pages to restore stretching and left-aligned text */
.calc-input-card,
.calc-result-card {
    align-items: stretch !important;
    text-align: left !important;
    width: 100% !important;
}

.calc-input-card h3,
.calc-result-card h3 {
    text-align: left !important;
    width: 100%;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .dashboard-layout {
        display: block !important;
        /* Prevent grid blowout */
        padding: 1rem 0.5rem;
        /* Tight padding for mobile */
        gap: 1rem;
        width: 100% !important;
    }

    .dashboard-layout>div {
        margin-bottom: 1.5rem;
        /* Simulate gap */
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Ensure calculator view respects standard content constraints */
#view-calculator.view-section {
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .dashboard-layout {
        padding: 2rem 2rem 1rem 2rem;
    }
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-navy);
    margin-bottom: 0.5rem;
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cccccc;
    border-radius: 12px;
    background-color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-gold);
    background-color: var(--white);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(to right, var(--primary-gold), var(--accent-gold));
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.02);
}

/* --- Output Box (Input preview) --- */
.area-preview {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--white);
    border: 1px dashed var(--primary-gold);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: var(--secondary-navy);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.area-preview .text-muted {
    color: #888;
    font-weight: 400;
    font-size: 0.85rem;
}

.output-box {
    background: var(--bg-cream);
    border: 1px dashed var(--primary-gold);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.output-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(140, 106, 41, 0.2);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.output-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.font-bold {
    font-weight: 700;
    color: var(--secondary-navy);
}

/* --- Results Area --- */
#results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
    color: var(--text-muted);
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* --- Bar --- */
.gradient-bar-container {
    position: relative;
    margin: 25px 0 10px 0;
    width: 100%;
}

.gradient-bar {
    height: 12px;
    width: 100%;
    background: linear-gradient(to right, #F44336 0%, #FF9800 25%, #FFeb3B 50%, #8BC34A 75%, #0F9D58 100%);
    border-radius: 10px;
}

.bar-pointer {
    position: absolute;
    top: -14px;
    /* left will be set dynamically via JS */
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #000;
    transition: left 0.5s ease-out;
}

.bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

/* --- Table --- */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.results-table th {
    background: #2d3748;
    color: var(--white);
    padding: 12px 15px;
    text-align: left;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background: var(--white);
}

.text-good {
    color: var(--success);
    font-weight: 400;
}

.text-bad {
    color: var(--danger);
    font-weight: 400;
}

.text-avg {
    color: var(--warning);
    font-weight: 400;
}

/* --- Result Summary Blocks --- */
.result-summary-block h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.result-summary-block p {
    margin: 0;
    line-height: 1.5;
}

/* --- Prose --- */
.prose h3,
.prose h4 {
    color: var(--primary-gold);
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.prose p {
    margin-bottom: 1rem;
    color: #444;
    text-align: justify;
}

/* --- Table Styling for Guide Content & Library --- */
.prose table,
#library-content table,
.library-article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 12px 6px;
    /* 12px horizontal, 6px vertical spacing between cells */
    margin: 1.5rem 0;
    background: transparent;
}

.prose th,
.prose td,
#library-content th,
#library-content td,
.library-article-content th,
.library-article-content td {
    padding: 12px 16px;
    border: 1.5px solid var(--border-soft);
    border-radius: 8px;
    background: var(--white);
    text-align: left;
    transition: all 0.2s ease;
    vertical-align: top;
}

.prose th,
#library-content th,
.library-article-content th {
    background: var(--bg-cream);
    color: var(--secondary-royal);
    font-weight: 600;
    border-color: var(--primary-gold);
}

/* Desktop optimization for spacing */
@media (min-width: 768px) {

    .prose table,
    #library-content table,
    .library-article-content table {
        border-spacing: 16px 8px;
        /* Slightly more relaxed on desktop */
    }
}

/* Ensure Telugu text handles padding well */
html[lang="te"] .prose th,
html[lang="te"] .prose td {
    line-height: 1.8;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}

.custom-table th,
.custom-table td {
    padding: 10px;
    border: 1px solid #eee;
}

.custom-table th {
    background: var(--secondary-navy);
    color: white;
}

.col-green {
    background: #E8F5E9;
    color: #1B5E20;
}

.col-orange {
    color: #E65100;
}


/* --- Table Colors for Vastu Tables --- */
.bg-red-light {
    background-color: #ffcdd2;
}

.bg-green-light {
    background-color: #c8e6c9;
}

.bg-orange-light {
    background-color: #ffe0b2;
}

.bg-gray-light {
    background-color: #f5f5f5;
}

.col-blue-light {
    background-color: #e3f2fd;
    color: var(--secondary-navy);
    font-weight: 600;
}

.header-gray {
    background-color: #eceff1;
    color: var(--text-dark);
}

/* --- Responsive Images --- */
.tab-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* --- Responsive Images (Global) --- */
img {
    max-width: 100%;
    height: auto;
}

/* Specific Content Images */
.prose img,
.panel img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 1.5rem auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.prose img:hover,
.panel img:hover {
    transform: scale(1.02);
}

/* --- Utility Classes (for injected content) --- */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}


/* --- Contact Section --- */
.contact-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
}

.contact-subtitle {
    text-align: center;
    font-size: 18px;
    color: #555;
    margin-bottom: 40px;
}

.contact-card-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-text {
    margin: 0;
    font-size: 18px;
    text-align: center;
    color: var(--text-muted);
}

/* --- Responsive Navigation & Layout System --- */

/* Mobile & Tablet Default (Bottom Nav, No Footer) */
body {
    padding-bottom: 95px;
    /* Increased from 70px as per request */
    /* Space for bottom nav */
}


.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #2c2c54;
    /* Deep Midnight Blue match */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
    overflow-x: hidden;
    /* Prevent horizontal stretch */
}

@media (max-width: 480px) {
    .bottom-nav {
        padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    }

    .bottom-nav .nav-item span {
        font-size: 0.7rem;
    }
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    /* White with opacity for inactive */
    font-size: 0.85rem;
    gap: 4px;
    flex: 1;
    padding: 6px 4px;
    /* Reduced from 8px */
    transition: all 0.3s;
    border-radius: 12px;
    min-width: 0;
}

.bottom-nav .nav-item i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
    /* Reduced from 1.4rem */
    margin-bottom: 2px;
    transition: transform 0.2s;
    color: rgba(255, 255, 255, 0.9);
}

.bottom-nav .nav-item span {
    display: block;
    width: 100%;
    line-height: 1.2;
    word-wrap: break-word;
}

.bottom-nav .nav-item.active {
    color: var(--primary-gold);
    /* Gold for active text */
    font-weight: 600;
}

.bottom-nav .nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary-gold);
    /* Gold for active icon */
}

/* Desktop Overrides (>= 1024px) */
@media (min-width: 1024px) {

    /* Desktop header - sticky to keep at top */
    .app-header {
        position: sticky;
        top: 0;
        margin-bottom: 0;
        /* Removed 2rem margin that was creating unwanted space */
    }

    /* Reset body padding for desktop */
    body {
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Hide Bottom Nav & Reset Body Padding */
    .bottom-nav,
    .hidden-desktop {
        display: none !important;
    }

    /* Show Footer */
    footer {
        display: block;
    }

    /* Desktop Header Nav */
    .desktop-nav {
        display: flex !important;
        /* Override hidden-mobile */
        align-items: center;
        gap: 1.5rem;
        margin-left: 3rem;
        flex-grow: 1;
    }

    .desktop-nav .nav-item {
        text-decoration: none;
        color: var(--secondary-royal);
        font-weight: 500;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 50px;
        transition: all 0.2s;
    }

    .desktop-nav .nav-item:hover {
        background: rgba(0, 0, 0, 0.04);
        color: var(--primary-gold);
    }

    .desktop-nav .nav-item.active {
        background: rgba(224, 122, 95, 0.1);
        color: var(--primary-gold);
        font-weight: 600;
    }

    /* Hide Hamburger on Desktop if desired, but user didn't explicitly ask to remove it. 
       Use .hidden-desktop-menu if we wanted to hide it.
       For now, we keep it as it has other items.
    */
}

/* Helper to hide desktop nav on mobile */
.hidden-mobile {
    display: none;
}

/* Helper to hide on mobile only (<= 768px) */
@media (max-width: 768px) {
    .hidden-mobile-only {
        display: none !important;
    }
}

/* Helper to show on mobile only (<= 768px) */
@media (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .hidden-touch {
        display: none !important;
    }
}



.contact-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 18px;
    color: #444;
}

ul,
ol {
    padding-left: 20px;
    margin-left: 0;
}

/* --- Dropdown Menus --- */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    max-width: 90vw;
    /* Prevent overflow on small screens */
    z-index: 1002;
    /* Above header */
    margin-top: 10px;
    display: block;
    background: transparent;
    border: 1px solid transparent;
}

.dropdown-menu.hidden {
    display: none;
}

/* Active State Styling Only */
.dropdown-menu.active {
    background: var(--white);
    border-radius: 20px;
    /* Proper border-radius */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    /* Premium shadow */
    padding: 0.75rem 0.5rem;
    /* Proper padding */
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: fadeIn 0.2s ease;
    overflow: hidden;
    /* No clipping (overflow issues) */
}

.dropdown-menu.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 12px;
    margin-bottom: 2px;
}

.dropdown-menu a:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg-cream);
    /* Soft hover */
    color: var(--primary-gold);
}

.dropdown-menu a i {
    width: 24px;
    text-align: center;
    color: var(--primary-gold);
    margin-right: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Carousel Styles --- */
.hero-slider::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for clean look */
}

.hero-slider {
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    max-width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.carousel-slide {
    flex: 0 0 100%;
    /* Full width per slide */
    width: 100%;
    height: 220px;
    /* Fixed height for carousel */
    object-fit: cover;
    scroll-snap-align: center;
}




/* --- Responsive Design --- */
html {
    font-size: 16px;
    /* Default */
}

@media (max-width: 1024px) {

    /* Tablet Portrait / Landscape */
    html {
        font-size: 15px;
    }

    .app-header {
        padding: 0.85rem 1rem;
    }

    .logo-container {
        height: 44px;
        width: 44px;
        aspect-ratio: 1 / 1;
        padding: 0;
    }

    .app-info h1 {
        font-size: 1.4rem;
    }

    html[lang="en"] .app-info h1 {
        font-size: 1.3rem;
    }
}

/* Tablet-specific sticky positioning */
@media (min-width: 769px) and (max-width: 1023px) {
    .app-header {
        position: sticky;
        top: 0;
        margin-bottom: 0;
    }

    body {
        padding-top: 0;
        padding-bottom: 70px;
        /* Bottom nav height */
    }
}

@media (max-width: 768px) {

    /* Mobile */
    html {
        font-size: 14px;
        /* Mobile base font */
    }

    /* Fixed header for mobile/WebView */
    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        margin-bottom: 0;
        z-index: 1000;
    }

    /* Remove body padding to prevent overflow */
    body {
        padding-top: 0;
        padding-bottom: 0;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
    }

    /* Content area should fit available space without forcing extra height */
    #app-content {
        min-height: auto;
        /* Remove fixed min-height */
        flex: 1;
        /* Grow to fill available space */
        margin-bottom: 0;
        /* Align perfectly with footer */
    }

    footer {
        margin-top: auto;
        /* Double safety to push to bottom */
    }

    /* .app-header and .app-logo removed to inherit Tablet styles (max-width: 1024px) */

    .app-info h1 {
        font-size: 1.55rem;
    }

    /* English specific reduction to prevent overflow/ovaling on small screens */
    html[lang="en"] .app-info h1 {
        font-size: 1.35rem;
    }

    .app-info p {
        display: none;
        /* Hide subtitle on small screens to save space */
    }

    /* Ensure clear touch targets - Excluding localized UI controls to prevent bloat */
    .icon-btn,
    .footer-link,
    button,
    a:not(.lang-toggle-link) {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Layout Adjustments - Mobile/Tablet only */
    /* Layout Adjustments - Mobile/Tablet only */
    .main-container {
        padding: 0;
        padding-top: 70px;
        /* Space for fixed header */
        padding-bottom: 70px;
        /* Reduced from 95px - Matches bottom nav height precisely to prevent gap */
    }



    .hero-slider {
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }

    .carousel-slide {
        height: 180px;
        /* Smaller hero on mobile */
    }

    /* Action Grid - 1 column already default, but ensures gap */
    .action-grid {
        gap: 1rem;
    }
}

/* --- Language Dropdown --- */
/* --- Language Dropdown --- */
.lang-option.active {
    font-weight: 700;
    color: white !important;
    background: #2C2C54 !important;
}



/* --- Header Language Switcher --- */
/* --- Header Language Switcher (Custom Dropdown) --- */
.header-lang-switcher {
    position: relative;
    display: flex;
    align-items: center;
    /* Remove padding/border from container, it will be on the button */
}

.header-lang-switcher:hover {
    background: transparent;
    box-shadow: none;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    color: var(--text-dark);
    background: rgba(44, 44, 84, 0.04);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-btn:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lang-btn i.fa-globe {
    color: var(--primary-gold);
    font-size: 1rem;
}

.lang-btn i.fa-chevron-down {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Custom Dropdown Menu */
#language-dropdown {
    min-width: 150px;
    top: 120%;
    right: 0;
    max-width: 200px;
}

#language-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--secondary-royal);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
}

#language-dropdown .dropdown-item:hover {
    background: rgba(44, 44, 84, 0.08) !important;
    color: var(--primary-gold) !important;
}

#language-dropdown .dropdown-item.active {
    background: #2C2C54 !important;
    color: white !important;
}




/* --- Mobile Sidebar Menu --- */
.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-royal);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-cream);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
}

.sidebar-menu.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.sidebar-content {
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--secondary-navy);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
    border-left: 4px solid transparent;
}

/* --- Sidebar Language Selector --- */
.sidebar-lang-selector {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.sidebar-lang-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
    font-weight: 600;
}

.sidebar-lang-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sidebar-lang-options .lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(44, 44, 84, 0.04);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-royal);
}

.sidebar-lang-options .lang-option:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-lang-options .lang-option.active {
    background: #2C2C54 !important;
    color: white !important;
    border-color: #2C2C54;
}

.sidebar-link i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    color: var(--primary-gold);
}

.sidebar-link:hover {
    background: rgba(44, 44, 84, 0.08) !important;
    color: var(--secondary-royal) !important;
}

.sidebar-link.active {
    background: #2C2C54 !important;
    color: white !important;
    border-left-color: var(--primary-gold);
}

.sidebar-link:hover i,
.sidebar-link.active i {
    color: white !important;
}

@media (min-width: 1024px) {

    .menu-btn,
    .sidebar-menu,
    .sidebar-overlay {
        display: none !important;
    }
}

.lang-toggle-link:hover {
    color: var(--primary-gold);
}

.lang-toggle-link.active {
    color: var(--secondary-royal);
    position: relative;
}

.lang-toggle-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 6px;
    right: 6px;
    height: 2px;
    background: var(--primary-gold);
    border-radius: 2px;
}

.lang-separator {
    color: var(--border-soft);
    font-weight: 300;
    font-size: 0.8rem;
}

.dashboard-card {
    background: linear-gradient(225deg, var(--white), #fffbf0);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(44, 44, 84, 0.04);
    border: 1px solid var(--border-soft);
    /* Subtle theme border */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(44, 44, 84, 0.08);
    border-color: var(--primary-gold);
}


.welcome-title {
    font-size: 2rem;
    color: var(--secondary-royal);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Header Redesign --- */
/* Dashboard layout handles spacing */


/* On desktop, the grid moves to the wrapper */
@media (min-width: 769px) {
    .app-header {
        display: block;
        padding: 0;
    }

    .app-header .content-wrapper {
        padding: 0 2rem;
        /* Remove vertical padding (handled by flex center + fixed height) */
    }
}

@media (min-width: 769px) {

    /* Tablet and Desktop: Header is sticky, not fixed, so no top padding needed */
    .main-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .app-header {
        position: sticky !important;
        /* Ensure sticky positioning on tablet/desktop */
    }

    .app-header .content-wrapper {
        max-width: 1400px;
    }

    /* Bottom nav remains visible on tablet */
}

/* Medium Desktop Responsiveness */
@media (min-width: 1024px) and (max-width: 1280px) {
    .app-header {
        padding: 0 1.25rem;
        gap: 0.75rem;
    }

    .header-tabs {
        gap: 0.25rem;
    }

    .header-tab {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }
}

/* Center Title Area in Header */
.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.current-section-title {
    display: none;
    /* Feature removed as per user request (hidden on all screens) */
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-navy);
    background: rgba(224, 122, 95, 0.08);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

/* Right Actions Area */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Header Tabs (Desktop Only) */
.header-tabs {
    display: none;
    /* Hidden by default (Mobile/Tablet) */
    gap: 0.5rem;
    background: rgba(44, 44, 84, 0.04);
    padding: 5px;
    border-radius: 50px;
    flex-wrap: nowrap;
}

.header-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 40px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-tab:hover {
    color: var(--secondary-royal);
    background: rgba(255, 255, 255, 0.527);
}

.header-tab.active {
    background: var(--white);
    color: var(--secondary-royal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

@media (min-width: 1024px) {

    /* Hide bottom nav on desktop */
    .bottom-nav {
        display: none;
    }

    .header-tabs {
        display: flex;
        /* Show Tabs on Desktop */
    }

    /* Position logo area and actions in balanced flex zones to center tabs */
    .header-left {
        flex: 1;
    }

    .header-right {
        flex: 1;
        justify-content: flex-end;
    }

    .header-lang-switcher {
        order: 999;
        /* Ensure it stays on the far right */
    }

    .current-section-title {
        display: none;
        /* Hide Title Pill on Desktop */
    }
}

/* Intermediate screens optimization (1024px - 1200px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .header-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .header-tabs {
        gap: 0.25rem;
    }

    .app-header {
        gap: 1rem;
        padding: 1rem;
    }
}

/* Responsive adjustments for header */
@media (max-width: 768px) {
    .app-header .content-wrapper {
        padding: 0;
        /* Wrapper handles padding */
        gap: 1rem;
    }

    .app-header {
        padding: 0.75rem 1rem;
    }

    .header-center {
        display: none;
        /* Hide center title on mobile to save space */
    }

    /* Force dashboard cards to full width on mobile, overriding inline styles */
    .dashboard-card {
        grid-column: 1 / -1 !important;
    }
}

/* prose styles follow */

/* --- Prose (About/Contact/Generic Content) --- */
.prose {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.prose h3 {
    color: var(--secondary-royal);
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px dashed var(--border-soft);
}

/* --- Library Reader Styles --- */
.library-reader-container {
    max-width: 100%;
    /* Match .alaya-container */
    margin: 1.5rem 0;
    /* Match .alaya-container */
    background: var(--white);
    border-radius: 20px;
    /* Match .alaya-card */
    padding: 2rem;
    /* Match .alaya-card */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Match .alaya-card */
    border: 1px solid rgba(212, 175, 55, 0.2);
    /* Match .alaya-card */
}

.library-article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.library-article-content h3 {
    color: var(--secondary-royal);
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    border-left: 5px solid var(--primary-gold);
    padding-left: 1rem;
}

.library-article-content h4 {
    color: var(--secondary-navy);
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.library-article-content p {
    margin-bottom: 1.5rem;
}

.library-article-content ul {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.library-article-content li {
    margin-bottom: 0.75rem;
}

.library-article-content hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px dashed var(--border-soft);
}

@media (max-width: 600px) {
    .library-reader-container {
        padding: 0.5rem;
        /* Match Alaya mobile padding */
        margin: 1.5rem 0;
        border-radius: 16px;
    }

    .library-article-content h3 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }
}

/* --- Main Footer Styles --- */

.main-footer {
    background-color: #2C2C54;
    color: var(--white);
    padding: 2rem 0;
    margin-top: auto;
    border-top: 4px solid var(--primary-gold);
    display: none;
}

.main-footer .content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    width: 100%;
}

@media (min-width: 1024px) {
    .main-footer {
        display: block;
        /* Show only on desktop/laptop */
    }

    .footer-grid {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-simple-link {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-simple-link:hover {
    color: var(--primary-gold);
}

/* --- Modal Styles --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 44, 84, 0.4);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-window {
    background: var(--bg-cream);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(224, 122, 95, 0.1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
    line-height: 1.8;
    color: var(--text-dark);
    overflow-y: auto;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--primary-gold);
}

/* --- Security Overrides --- */
/* Functionality preservation for forms */
input,
textarea,
select,
[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important;
}

/* Disable drag on images explicitly */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
    /* Prevents right click and drag on mobile mostly */
}

/* --- Compass Feature Styles --- */
.compass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.compass-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 20px auto;
}

.compass-dial {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s linear;
    border: 8px solid var(--secondary-royal);
}

.compass-face {
    position: relative;
    width: 100%;
    height: 100%;
}

.compass-mark {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    padding-top: 15px;
    font-weight: 700;
    color: var(--secondary-royal);
}

.compass-mark span {
    font-size: 1.2rem;
}

.mark-n {
    color: var(--primary-gold);
    padding-top: 10px;
    font-size: 1.5rem;
}

.mark-sub span {
    font-size: 0.9rem;
    padding-top: 18px;
    color: var(--text-muted);
}

.mark-mini span {
    font-size: 0.65rem;
    padding-top: 22px;
    color: #bbb;
}

.degree-ticks {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.compass-dial::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid var(--primary-gold);
    z-index: 10;
}

.compass-center-disc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 4px solid var(--bg-cream);
}

.degrees-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-royal);
}

.direction-val {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Mandalam Feature Styles --- */
.mandalam-svg-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#mandalam-svg {
    max-width: 100%;
    height: auto;
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .compass-container {
        width: 280px;
        height: 280px;
    }

    .compass-center-disc {
        width: 100px;
        height: 100px;
    }

    .degrees-val {
        font-size: 1.25rem;
    }
}

/* --- Digital Compass Component --- */
.digital-compass-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 60px auto;
    /* 60px vertical margin for maximum breathing room */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    /* Professional premium look */
}

.compass-dial-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.compass-needle {
    position: absolute;
    width: 4px;
    height: 140px;
    background: #c62828;
    bottom: 50%;
    left: 50%;
    z-index: 10;
    border-radius: 4px 4px 0 0;
    transform-origin: bottom center;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.compass-needle::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #c62828;
}

.compass-center-pin {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #2c2c54;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    .digital-compass-container {
        width: 280px;
        height: 280px;
    }

    .compass-needle {
        height: 120px;
    }
}

/* --- Ayam Calculator Results Typography Refinement --- */
#results-content {
    line-height: 1.5 !important;
}

/* Headings in the results area */
#results-content h3 {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--secondary-navy) !important;
    margin-bottom: 1.25rem !important;
}

#results-content h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--secondary-royal) !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
}

/* Headings and bold text in the results area (on light backgrounds) */
#results-content strong,
#results-content b,
#results-content .rec-label {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--secondary-royal) !important;
}

/* Table headers - must be white for contrast against dark background */
#results-content .results-table thead th {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--white) !important;
}

/* Body / Result text (The actual values) */
#results-content td,
#results-content p {
    font-size: 15px !important;
    font-weight: 400 !important;
    color: var(--text-dark) !important;
    line-height: 1.5 !important;
}

/* Status result text - must override general body color */
#results-content .text-good,
#results-content .text-excellent,
#results-content .text-best {
    color: var(--success) !important;
    font-weight: 500 !important;
}

#results-content .text-bad,
#results-content .text-poor,
#results-content .text-worst {
    color: var(--danger) !important;
    font-weight: 500 !important;
}

#results-content .text-avg,
#results-content .text-neutral {
    color: var(--warning) !important;
    font-weight: 500 !important;
}

/* Scale text within tables and boxes */
#results-content .results-table td {
    padding-bottom: 8px !important;
}

/* Specific box text */
#results-content #pdf-summary-section table td {
    font-size: 15px !important;
    line-height: 1.5 !important;
}

#results-content #aayam-vyayam-box p {
    font-size: 14px !important;
}

/* Mobile font size reduction for results */
@media (max-width: 600px) {
    #results-content h3 {
        font-size: 16px !important;
        margin-bottom: 0.75rem !important;
    }

    #results-content h4 {
        font-size: 14px !important;
        margin-top: 1rem !important;
    }

    #results-content td,
    #results-content p,
    #results-content span,
    #results-content strong,
    #results-content b {
        font-size: 13px !important;
    }

    #results-content .results-table thead th {
        font-size: 13px !important;
        padding: 8px 4px !important;
    }

    #results-content #pdf-summary-section {
        padding: 0 !important;
    }
}


/* Ensure these UI refinements don't propagate to the PDF export container */
#pdf-export-container * {
    font-size: revert !important;
    line-height: revert !important;
    font-weight: revert !important;
}

/* --- Action Buttons (Adapted from Alaya UI) --- */
.footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: auto;
    /* Push to bottom if inside a flex card */
    flex-wrap: wrap;
    padding-bottom: 0;
    /* Remove bottom padding that might cause gaps */
}

.primary-btn,
.secondary-btn,
.back-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    border: none;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-gold), #e64a19);
    color: white;
    box-shadow: 0 4px 15px rgba(191, 54, 12, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 54, 12, 0.3);
}

.secondary-btn {
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-gold));
    color: white;
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.2);
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.3);
}

.back-btn {
    background: white;
    color: var(--text-dark);
    border: 2px solid #eee;
}

.back-btn:hover {
    background: #f9f9f9;
    border-color: #ddd;
}

.btn-reset {
    background: #4A5568 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.15) !important;
}

.btn-reset:hover {
    background: #2D3748 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 85, 104, 0.25) !important;
}

@media (max-width: 600px) {
    .footer-actions {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- Contact Page Enhancements --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contact-card {
    background: linear-gradient(225deg, var(--white) 0%, #f4ead5 100%);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--primary-gold);
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(44, 44, 84, 0.04);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(44, 44, 84, 0.08);
    border-color: var(--primary-gold);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--secondary-royal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.contact-card:hover .contact-icon {
    background: var(--secondary-royal);
    color: white;
}

.contact-card.whatsapp:hover .contact-icon {
    background: #25D366;
    color: white;
}

.contact-label {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--secondary-royal);
    margin-top: 0.5rem;
}

.contact-value {
    color: #475569;
    font-size: 1rem;
    font-weight: 500;
}

.contact-btn {
    margin-top: 0.5rem;
    padding: 0.7rem 1.4rem;
    background: var(--secondary-royal);
    color: white;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.contact-card:hover .contact-btn {
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Home Page Dashboard & Banner Consolidate --- */
#view-home .dashboard-layout {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    gap: 1.5rem;
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

#view-home .dashboard-card {
    grid-column: span 4;
    /* 3 columns on desktop (12/4 = 3) */
    background: linear-gradient(135deg, #FFFDF5 0%, #F7EAD0 100%);
    padding: 1.5rem;
    /* Standard desktop padding */
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(21, 25, 43, 0.05), inset 0 0 20px rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-gold);
    cursor: pointer;
}

@media (max-width: 480px) {
    .dashboard-card {
        padding: 1rem !important;
        /* Force smaller padding on mobile */
    }

    .form-row,
    .user-info-summary {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(44, 44, 84, 0.1);
    border-color: var(--primary-gold);
}

.supporting-image-section {
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 0px !important;
    /* Minimal space under banner */
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.supporting-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@media (max-width: 1024px) {
    #view-home .dashboard-layout {
        grid-template-columns: repeat(2, 1fr) !important;
        /* Forces 2 columns regardless of child spans */
        gap: 0.8rem;
        padding: 1rem 0;
    }

    #view-home .dashboard-card {
        grid-column: span 1 !important;
        /* 2 columns (2/1 = 2) */
        padding: 1.25rem 0.5rem;
        border-radius: 16px;
    }

    .dashboard-card h3 {
        font-size: 0.95rem !important;
        margin-top: 5px;
    }

    .dashboard-card p {
        font-size: 0.75rem !important;
        text-align: center;
        line-height: 1.3;
    }

    .dashboard-card .icon-box {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
    }

    .supporting-image-section {
        margin-top: 1rem;
        margin-bottom: 0px !important;
        border-radius: 16px;
    }
}

/* --- Validation Toast --- */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    color: #ff5252;
}

/* --- Form Elements Refinement --- */
.form-select-styled {
    padding: 12px 10px;
    /* Increased padding for better text visibility */
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 100%;
    height: auto;
    line-height: 1.6;
    /* Increased line-height for Telugu characters */
    background-color: #fff;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
}

.form-select-styled:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(193, 154, 91, 0.2);
}