/*
 * myAstro Professional Theme CSS
 * A modern, elegant design for the Hindi Horoscope Generator
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* ============================================
   CSS Variables - Easy Theme Customization
   ============================================ */
:root {
    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;

    /* Secondary Colors */
    --secondary-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --secondary-color: #f59e0b;

    /* Accent Colors */
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Neutral Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #ffffff;
    --bg-light: #f8fafc;
    --bg-input: #f1f5f9;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Typography System — Contrasting Font Roles
   ============================================ */

/* ROLE 1 — SERIF (Playfair Display)
   Page hero titles, H1, H2, large display headings
   Pairs with: maroon/gold colours, uppercase labels */
h1, h2,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.page-title,
.hero-title,
.ih-hero h1, .ih-hero h2,
.course-hero h1, .course-hero h2 {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Italic accent for hero sub-headings */
.hero-subtitle, .ih-hero p.lead {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-style: italic;
    font-weight: 400;
}

/* ROLE 2 — GEOMETRIC SANS (Poppins)
   Menus, nav links, card headers, section labels,
   badge text, tab labels, button text.
   Pairs with: body copy / Inter below it */
h3, h4, h5, h6,
.card-header, .card-header *,
.page-card-header, .page-card-header *,
.nav-link, .dropdown-item, .dropdown-toggle,
.navbar-nav .nav-link,
.navbar-brand,
.navbar-brand *,
.ih-section-label,
.badge,
.btn,
.tab-content .nav-link,
label, .form-label,
.fw-bold.text-uppercase,
.ih-stat-label {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
}

/* Card header specifically — bold Poppins for contrast vs body */
.card-header h5, .card-header h6,
.page-card-header h5, .page-card-header h6 {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Navbar menu items — Poppins, slightly tighter tracking */
.navbar-nav-main .nav-link,
.navbar-nav-main .dropdown-toggle {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Dropdown menu items — Poppins, readable weight */
.dropdown-menu .dropdown-item {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

/* Dropdown section headers (like "Menu Visibility") — Poppins Bold */
.dropdown-menu .dropdown-header {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ROLE 3 — HUMANIST SANS (Inter)
   Body text, paragraphs, muted text, form inputs.
   Most readable at small sizes */
body, p, span, div,
.text-muted, small,
.form-control, .form-select,
.input-group-text,
textarea {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Poppins stat numbers — bold display figures */
.ih-stat-number {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 800;
}

/* Gold uppercase section labels — Poppins always */
.ih-section-label,
[style*="text-transform: uppercase"][style*="#C9963B"],
[style*="textTransform: uppercase"] {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700;
    letter-spacing: 0.15em;
}

/* ============================================
   End Typography System
   ============================================ */

/* ============================================
   Global Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   Navbar Styling — background set in styles.py inline CSS
   Only layout/spacing/text overrides here
   ============================================ */
#navbar-main {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
}

#navbar-main > .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
}

/* Nav link pills */
.navbar-nav-main .nav-link {
    color: #000000 !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.3rem 0.75rem !important;
    border-radius: 20px;
    margin: 0 2px;
    transition: background 0.2s, color 0.2s;
}

.navbar-nav-main .nav-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #C9963B !important;
}

.navbar-nav-main .nav-link.active {
    background: rgba(201, 150, 59, 0.18) !important;
    color: #C9963B !important;
    border-bottom: 3px solid #C9963B;
    font-weight: 600;
}

/* Dropdown toggle in navbar */
.navbar-nav-main .dropdown-toggle {
    color: #000000 !important;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: 20px;
    padding: 0.3rem 0.75rem !important;
    margin: 0 2px;
}

.navbar-nav-main .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #C9963B !important;
}


/* ============================================
   Horoscope Analysis Tabs
   ============================================ */
#horoscope-analysis-output .nav-tabs {
    border-bottom: 3px solid #C9963B !important;
    background: transparent;
}

#horoscope-analysis-output .nav-tabs .nav-link {
    background: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px 6px 0 0 !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    padding: 6px 14px !important;
    margin-right: 3px !important;
    opacity: 1 !important;
}

#horoscope-analysis-output .nav-tabs .nav-link:hover {
    background: #1a1a1a !important;
    color: #C9963B !important;
    border: none !important;
}

#horoscope-analysis-output .nav-tabs .nav-link.active {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: none !important;
    border-bottom: 3px solid #C9963B !important;
    font-weight: 700 !important;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem !important;
    letter-spacing: -0.5px;
}

.navbar .btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.navbar .btn-light {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--primary-color);
}

.navbar .btn-light:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

#language-selector-container .form-check {
    margin-bottom: 0;
    padding-left: 0;
}

.lang-selector {
    gap: 0.35rem;
}

.lang-selector .btn {
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    min-width: 2.5rem;
    font-weight: 600;
}

.lang-selector .btn:hover,
.lang-selector .btn.active {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
}

/* ============================================
   Login Page Styling
   ============================================ */
#login-page {
    background: linear-gradient(160deg, #12003E 0%, #3D0808 40%, #6B1A1A 70%, #2D1200 100%);
    min-height: calc(100vh - 60px);
    position: relative;
    overflow: hidden;
}

#login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

#login-page .container {
    position: relative;
    z-index: 1;
}

#login-page h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 3.5rem;
}

#login-page h1 i {
    color: #C9963B !important;
    -webkit-text-fill-color: #C9963B;
}

#login-page h4 {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1);
}

#login-page p.text-secondary {
    color: rgba(255, 255, 255, 0.85) !important;
}

#login-page .card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 150, 59, 0.4);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

#login-page .card-body {
    padding: 2.5rem;
}

/* Google Sign-In Button */
#btn-google-signin,
#btn-google-signin-login,
#btn-google-signin-signup {
    background: #4285F4 !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    padding: 0.625rem 1rem !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

#btn-google-signin:hover,
#btn-google-signin-login:hover,
#btn-google-signin-signup:hover {
    background: #3367d6 !important;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Login/Signup Buttons on Login Page */
#btn-login-page, #btn-signup-page {
    padding: 0.875rem 1.5rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

#btn-login-page {
    background: var(--primary-gradient) !important;
    border: none !important;
}

#btn-login-page:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4) !important;
}

#btn-signup-page {
    background: var(--success-gradient) !important;
    border: none !important;
}

#btn-signup-page:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4) !important;
}

/* ============================================
   Main Content Area
   ============================================ */
#main-content {
    background: var(--bg-light);
    min-height: calc(100vh - 120px);
}

/* ============================================
   Header Section
   ============================================ */
.bg-light.border-bottom {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 2rem 0 !important;
}

.bg-light h1 {
    font-family: 'Poppins', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 2.5rem;
}

.bg-light h4 {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

/* ============================================
   Card Styles
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: #001a33 !important;
    color: var(--text-white) !important;
    border: none !important;
    padding: 1.25rem 1.5rem !important;
    font-weight: 600;
    border-radius: 0 !important;
}

.card-header h4 {
    color: var(--text-white) !important;
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem !important;
}

/* ============================================
   Form Styles
   ============================================ */
.form-label, label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Input Groups */
.input-group {
    box-shadow: none;
}

.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0 !important;
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    text-transform: none;
    letter-spacing: 0;
    border: none;
}


.btn-primary {
    background: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
}

.btn-primary:hover:not(:disabled) {
    background: #6e1414 !important;
    border-color: #6e1414 !important;
    box-shadow: 0 4px 14px rgba(139, 26, 26, 0.35);
}

.btn-success {
    background: var(--success-gradient);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(71, 85, 105, 0.35);
}

.btn-light {
    background: #ffffff;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-light:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Theme button variants — defined last to win cascade */
#btn-home-question-ask {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    border: none !important;
}

/* Horoscope page buttons — ID-targeted for maximum specificity */
#btn-generate-horoscope,
#btn-show-horoscope,
#btn-view-full-html,
#btn-download-horoscope,
#btn-horoscope-analysis {
    background: #8B1A1A !important;
    background-color: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
}
#btn-generate-horoscope:disabled,
#btn-show-horoscope:disabled,
#btn-view-full-html:disabled,
#btn-download-horoscope:disabled,
#btn-horoscope-analysis:disabled {
    background: #8B1A1A !important;
    background-color: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
    opacity: 0.7;
}

.btn-crimson {
    background: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
}
.btn-crimson:hover:not(:disabled) {
    background: #6e1414 !important;
    border-color: #6e1414 !important;
}
.btn-crimson:disabled,
.btn-crimson[disabled] {
    background: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
    opacity: 0.65;
}

.btn-gold {
    background: #C9963B !important;
    border-color: #C9963B !important;
    color: #2D1B00 !important;
}
.btn-gold:hover:not(:disabled) {
    background: #a97a2e !important;
    border-color: #a97a2e !important;
}
.btn-gold:disabled,
.btn-gold[disabled] {
    background: #C9963B !important;
    border-color: #C9963B !important;
    color: #2D1B00 !important;
    opacity: 0.65;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    background: #FFF8F0;
}

.modal-header {
    background: linear-gradient(135deg, #8B1A1A 0%, #6B1A1A 100%);
    color: var(--text-white);
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-white) !important;
}

.modal-body {
    padding: 2rem;
    background: #FFF8F0;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background: #FFF8F0;
}

/* ============================================
   Alert Styles
   ============================================ */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
}

/* ============================================
   Accordion Styles
   ============================================ */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-light);
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: #001a33;
    color: var(--text-white);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.accordion-body {
    padding: 1.25rem;
    background: #ffffff;
}

/* ============================================
   Table Styles
   ============================================ */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.table thead th {
    background: #001a33;
    color: var(--text-white);
    font-weight: 600;
    padding: 1rem;
    border: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.02);
}

/* ============================================
   Dropdown Styles
   ============================================ */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Course dropdown: scrollable so Level 1 + Level 2 items don't overflow the viewport */
.course-nav-dropdown .dropdown-menu {
    max-height: 80vh;
    overflow-y: auto;
    min-width: 240px;
}

/* ============================================
   Loading Animation
   ============================================ */
._dash-loading {
    margin: 3rem auto;
}

._dash-loading-callback {
    background: var(--primary-gradient) !important;
}

/* ============================================
   Footer Styles
   ============================================ */
.py-3.px-3.px-md-5:last-child {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.py-3 p {
    color: var(--text-secondary);
}

.py-3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.py-3 a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Horoscope Output Styles
   ============================================ */
#horoscope-output {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Location display */
#location-display {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
}

/* Chart containers */
.chart-container {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

/* SVG Charts */
svg {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Desktop: main menu items in a horizontal row */
@media (min-width: 992px) {
    #main-menu-section {
        display: flex !important;
        align-items: center;
    }

    .navbar-nav-main {
        flex-direction: row !important;
    }
}

/* Mobile navbar: menu items shown as an app-style icon grid (like Android home screen icons) */
@media (max-width: 991px) {
    #main-menu-section {
        width: 100%;
        padding: 0.5rem 0.25rem;
    }

    .navbar-nav-main {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.35rem;
        width: 100%;
    }

    .navbar-nav-main .nav-link,
    .navbar-nav-main .dropdown-toggle {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px;
        text-align: center;
        border-bottom: none !important;
        border-radius: 12px !important;
        padding: 0.6rem 0.25rem !important;
        margin: 0 !important;
        background: linear-gradient(135deg, #E8C97A 0%, #C9963B 100%) !important;
    }

    .navbar-nav-main .nav-link i,
    .navbar-nav-main .dropdown-toggle i {
        font-size: 1.35rem;
        margin: 0 !important;
        color: #2D1B00 !important;
    }

    .navbar-nav-main .nav-link span,
    .navbar-nav-main .dropdown-toggle span {
        font-size: 0.65rem;
        line-height: 1.1;
        white-space: normal;
        color: #2D1B00 !important;
        font-weight: 600;
    }

    /* Auth section stacks below menu */
    .navbar-auth-section {
        width: 100%;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #logged-in-section {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    .navbar-toggler {
        color: white !important;
        border-color: rgba(255,255,255,0.3) !important;
    }
}

@media (max-width: 768px) {
    #login-page h1 {
        font-size: 2.5rem;
    }

    #login-page .card-body {
        padding: 1.5rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .table thead th {
        padding: 0.75rem;
        font-size: 0.7rem;
    }

    .table tbody td {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Home page cards: 2 per row on small screens */
    .compact-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    #login-page h1 {
        font-size: 1.8rem;
    }

    .navbar-brand img {
        height: 36px !important;
    }

    #login-page .card-body {
        padding: 1.25rem;
    }

    /* Home page cards: 1 per row on extra small */
    .compact-col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .py-2.px-2.page-container {
        padding: 0.5rem !important;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* ============================================
   Selection Styling
   ============================================ */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ============================================
   Form Text & Hints
   ============================================ */
.form-text {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ============================================
   HR Divider
   ============================================ */
hr {
    border-color: var(--border-color);
    opacity: 0.5;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea, .btn, .card, .accordion-button {
    transition: var(--transition);
}

/* ============================================
   iframe styling
   ============================================ */
iframe {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Mobile app-mode bottom tab bar
   Only shown when installed as a PWA ("standalone" display-mode) on a
   phone-sized screen — replaces the hamburger menu with native-app-style
   tabs. All other menus stay in the top nav / as cards on the home page.
   ============================================ */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav-link {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 0.65rem;
    line-height: 1.1;
    text-decoration: none !important;
    padding: 6px 2px !important;
    cursor: pointer;
}

.mobile-bottom-nav-link i {
    font-size: 1.15rem;
}

.mobile-bottom-nav-link.active {
    color: #C9963B !important;
}

.mobile-bottom-nav-btn {
    background: none;
    border: none;
    margin: 0;
}

@media (display-mode: standalone) and (max-width: 991px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: #1a0a0a;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
    }

    body {
        padding-bottom: 64px;
    }

    /* The bottom bar replaces the hamburger + its collapsible menu */
    #navbar-toggler,
    #navbar-collapse {
        display: none !important;
    }

    /* Lift the floating chatbot above the bottom tab bar so its logo/label
       doesn't overlap the nav (app-mode only; the bottom bar isn't shown
       in a regular mobile browser tab). */
    .chatbot-fab {
        bottom: calc(64px + env(safe-area-inset-bottom) + 16px) !important;
    }
    .chatbot-teaser {
        bottom: calc(64px + env(safe-area-inset-bottom) + 84px) !important;
    }
    .chatbot-window {
        bottom: calc(64px + env(safe-area-inset-bottom) + 88px) !important;
        max-height: calc(100vh - 64px - env(safe-area-inset-bottom) - 122px) !important;
    }
}

/* "More" bottom sheet — rows matching the bottom-nav's native-app feel */
.more-menu-offcanvas {
    max-height: 75vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.more-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid #E7E5E4;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.more-menu-item:last-child {
    border-bottom: none;
}

.more-menu-item i {
    font-size: 1.05rem;
    text-align: center;
}

/* ============================================
   Mobile "Install App" banner
   Auto-shown on mobile visits when the site isn't installed as a PWA yet.
   ============================================ */
.pwa-install-banner {
    display: none;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #1a0a0a;
    color: #fff;
    padding: 10px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.pwa-install-banner-icon {
    font-size: 1.4rem;
    color: #E8C97A;
    flex-shrink: 0;
}

.pwa-install-banner-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.pwa-install-banner-text strong {
    font-size: 0.85rem;
}

.pwa-install-banner-text span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
}

.pwa-install-banner-btn {
    background: #E8C97A;
    color: #1a0a0a;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pwa-install-banner-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}

/* ============================================
   Mobile page polish
   Makes the pages behind the bottom tabs (Home, Members, Horoscope,
   Astro Assist, and the "More" destinations) comfortable to read and
   tap on phones.
   ============================================ */
@media (max-width: 767px) {
    /* Tighter page shell so content gets the width */
    .page-container {
        padding: 0.75rem 0.5rem !important;
    }

    .page-container .card {
        border-radius: 12px;
    }

    .page-container .card-body {
        padding: 0.85rem !important;
    }

    /* Readable heading scale on small screens */
    .page-container h4 {
        font-size: 1.15rem;
    }

    .page-container h5 {
        font-size: 1rem;
    }

    .page-container p,
    .page-container .list-group-item {
        font-size: 0.9rem;
    }

    /* Tap-friendly buttons: bigger targets, even wrapping */
    .page-container .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .page-container .d-flex.flex-wrap > .btn {
        flex: 1 1 auto;
        margin-left: 0 !important;
        margin-right: 0 !important;
        white-space: nowrap;
    }

    /* Wide tables (horoscope charts, admin lists) scroll sideways
       instead of squeezing into unreadable columns */
    .page-container table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Alerts and info strips: smaller text, comfortable padding */
    .page-container .alert {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }

    /* Modals span nearly the whole screen */
    .modal-dialog {
        margin: 0.5rem;
        max-width: none;
    }

    /* Badge rows and stats strips wrap without overflowing */
    .page-container .badge {
        font-size: 0.68rem;
    }
}


/* ============================================
   Home feature cards
   Uniform, professional card grid on the home page.
   ============================================ */
.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 18px 12px 16px;
    background: #fff;
    border: 1px solid #EDE8E0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(60, 32, 14, 0.06);
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(60, 32, 14, 0.12);
    border-color: rgba(201, 150, 59, 0.55);
    color: inherit;
}

.feature-card-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FDF3E0 0%, #F7E3BC 100%);
    border: 1px solid rgba(201, 150, 59, 0.30);
    flex-shrink: 0;
}

.feature-card-emoji {
    font-size: 1.7rem;
    line-height: 1;
}

.feature-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1C1917;
    margin-bottom: 4px;
}

.feature-card-desc {
    font-size: 0.76rem;
    color: #78716C;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Locked (upgrade-required) variant */
.feature-card-locked {
    background: #FBF7F0;
    opacity: 0.85;
}

.feature-card-icon-locked {
    background: #F0EDE8;
    border-color: #E0DCD5;
}

.feature-card-icon-locked .feature-card-emoji {
    opacity: 0.45;
    filter: grayscale(60%);
}

.feature-card-lock {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #E0DCD5;
    color: #A8A29E;
    font-size: 0.6rem;
}

/* ===== Theme-consistent buttons ===== */
.btn-theme {
    background-color: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
}
.btn-theme:hover, .btn-theme:focus, .btn-theme:active {
    background-color: #6E1414 !important;
    border-color: #6E1414 !important;
    color: #ffffff !important;
}
.btn-theme-outline {
    background-color: transparent !important;
    border: 1px solid #8B1A1A !important;
    color: #8B1A1A !important;
}
.btn-theme-outline:hover, .btn-theme-outline:focus, .btn-theme-outline:active {
    background-color: rgba(139, 26, 26, 0.08) !important;
    color: #8B1A1A !important;
}
.btn-theme-gold {
    background-color: #C9963B !important;
    border-color: #C9963B !important;
    color: #2D1B00 !important;
}
.btn-theme-gold:hover, .btn-theme-gold:focus, .btn-theme-gold:active {
    background-color: #B3832F !important;
    border-color: #B3832F !important;
    color: #2D1B00 !important;
}
.btn-theme:disabled, .btn-theme.disabled,
.btn-theme-outline:disabled, .btn-theme-outline.disabled,
.btn-theme-gold:disabled, .btn-theme-gold.disabled {
    opacity: 0.45;
}

/* ===== Global brand theme for Bootstrap variants (all pages) =====
   Maps multi-colored Bootstrap buttons to the maroon/gold palette so
   every page is consistent without per-page changes. Buttons only �
   badges/alerts keep semantic status colors. `light`/`link` untouched
   (used on dark navbar). */
.btn-primary, .btn-success, .btn-info, .btn-danger, .btn-dark {
    background-color: #8B1A1A !important;
    border-color: #8B1A1A !important;
    color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-success:hover, .btn-success:focus, .btn-success:active,
.btn-info:hover, .btn-info:focus, .btn-info:active,
.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.btn-dark:hover, .btn-dark:focus, .btn-dark:active {
    background-color: #6E1414 !important;
    border-color: #6E1414 !important;
    color: #ffffff !important;
}
.btn-warning {
    background-color: #C9963B !important;
    border-color: #C9963B !important;
    color: #2D1B00 !important;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: #B3832F !important;
    border-color: #B3832F !important;
    color: #2D1B00 !important;
}
.btn-secondary,
.btn-outline-primary, .btn-outline-secondary, .btn-outline-success,
.btn-outline-info, .btn-outline-danger, .btn-outline-warning, .btn-outline-dark {
    background-color: transparent !important;
    border: 1px solid #8B1A1A !important;
    color: #8B1A1A !important;
}
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active,
.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-success:hover,
.btn-outline-info:hover, .btn-outline-danger:hover, .btn-outline-warning:hover,
.btn-outline-dark:hover {
    background-color: rgba(139, 26, 26, 0.08) !important;
    color: #8B1A1A !important;
}
.btn-primary:disabled, .btn-success:disabled, .btn-info:disabled,
.btn-danger:disabled, .btn-dark:disabled, .btn-warning:disabled,
.btn-secondary:disabled {
    opacity: 0.45;
}

/* ===== Modern mobile-first component polish ===== */
.btn {
    border-radius: 10px;
    font-weight: 600;
}
.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(201, 150, 59, 0.35) !important;
}
.form-control, .form-select, .input-group-text {
    border-radius: 10px;
    border-color: #E7E5E4;
}
.form-control:focus, .form-select:focus {
    border-color: #C9963B;
    box-shadow: 0 0 0 3px rgba(201, 150, 59, 0.2);
}
.card {
    border-radius: 12px;
    border-color: #E7E5E4;
}
.modal-content {
    border-radius: 16px;
    border: none;
}
.nav-tabs .nav-link {
    color: #6B5E5E;
    font-weight: 600;
}
.nav-tabs .nav-link.active {
    color: #8B1A1A;
    border-bottom: 3px solid #8B1A1A;
    background-color: transparent;
}
.nav-pills .nav-link.active {
    background-color: #8B1A1A !important;
    color: #ffffff !important;
}
.spinner-border.text-primary, .spinner-grow.text-primary {
    color: #8B1A1A !important;
}
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.mobile-bottom-nav-link):not(.feature-card) {
    color: #8B1A1A;
}

@media (max-width: 767px) {
    .btn:not(.btn-sm):not(.btn-close):not(.mobile-bottom-nav-btn) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .modal-dialog-centered .modal-content {
        border-radius: 16px;
    }
    .form-control, .form-select {
        font-size: 16px; /* prevents iOS zoom-on-focus */
        min-height: 44px;
    }
}

/* ===== Themed modal headers (all modals) ===== */
.modal-header {
    background: linear-gradient(135deg, #1a0a0a 0%, #3d1515 100%);
    color: #ffffff;
    border-bottom: 2px solid #C9963B;
}
.modal-header .modal-title {
    color: #ffffff;
    font-weight: 600;
}
.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.modal-body {
    background-color: #FDF8F0;
}
.modal-footer {
    background-color: #FDF8F0;
    border-top: 1px solid #E7E5E4;
}

/* ===== Reports / history list (modern mobile rows) ===== */
.report-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #E7E5E4;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.report-item-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C9963B 0%, #E8C97A 100%);
    color: #2D1B00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.report-item-body {
    flex: 1;
    min-width: 0;
}
.report-item-title {
    font-weight: 700;
    color: #2F1B1B;
    margin-bottom: 2px;
}
.report-item-meta {
    font-size: 0.8rem;
    color: #6B5E5E;
    margin-bottom: 4px;
}
.report-item-time {
    display: inline-block;
    font-size: 0.72rem;
    color: #8B1A1A;
    background: rgba(139, 26, 26, 0.07);
    border-radius: 999px;
    padding: 2px 10px;
}

/* ===== Modern themed accordions (horoscope report & app-wide) ===== */
.accordion-item {
    border: 1px solid #E7E5E4 !important;
    border-radius: 12px !important;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.accordion-button {
    background-color: #ffffff;
    color: #2F1B1B;
    font-weight: 600;
    padding: 14px 16px;
}
.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #FDF8F0 0%, #F7EDDD 100%);
    color: #8B1A1A;
    box-shadow: inset 0 -1px 0 #E7E5E4;
}
.accordion-button:focus {
    border-color: #C9963B;
    box-shadow: 0 0 0 3px rgba(201, 150, 59, 0.25);
}
.accordion-button::after {
    filter: grayscale(1) opacity(0.7);
}
.accordion-body {
    background-color: #fffdf9;
}

/* ===== Horoscope report (mobile-first) ===== */
.horoscope-report .birth-info-card {
    border: 1px solid #E7E5E4;
    border-radius: 12px;
    background: #FDF8F0;
    height: 100%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.horoscope-report .birth-info-card h6:last-child {
    color: #8B1A1A;
    font-weight: 700;
}
.horoscope-report .table {
    background-color: #ffffff;
}

@media (max-width: 767px) {
    /* Many report sub-cards (ascendant summary, panchang years, current
       status, mangal dosha, planet-summary strip) only declare a `md`
       width. Without an explicit mobile width they'd sit cramped
       side-by-side instead of stacking, so give them a readable 2-up
       grid on phones. */
    .horoscope-report .row > [class^="col-md-2"],
    .horoscope-report .row > [class^="col-md-3"],
    .horoscope-report .row > [class^="col-md-4"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
    /* Two-up cards with paragraph content (Sade Sati / Panoti status,
       etc.) read better stacked full-width on phones. */
    .horoscope-report .row > [class^="col-md-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
.horoscope-report .table > :not(caption) > * > * {
    vertical-align: middle;
}

@media (max-width: 767px) {
    .horoscope-report .table {
        font-size: 0.76rem;
    }
    .horoscope-report .table th,
    .horoscope-report .table td {
        padding: 6px 8px;
        white-space: nowrap;
    }
    .horoscope-report .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        border: 1px solid #E7E5E4;
    }
    .horoscope-report h2 {
        font-size: 1.35rem;
    }
    .accordion-button {
        font-size: 0.9rem;
        padding: 12px 12px;
    }
    .accordion-body {
        padding: 10px 8px;
    }
}
