/* =====================================================================
   DHEERAJA MATRIMONY — FULL PRODUCTION ADVANCED ENTERPRISE STYLESHEET
   ---------------------------------------------------------------------
   Architecture: Modular BEM-like CSS with Design Tokens
   Covers: Public Pages, Auth, 6-Step Wizard, Tinder-Swipe Deck, 
           Guna Milan Calculator, Premium Chat, Razorpay Checkout, 
           Admin Panel & Mobile WebApp Layout.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* =====================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES
   ===================================================================== */
:root {
    /* Brand Theme Colors */
    --primary: #C81E3D;               /* Deep Velvet Red */
    --primary-dark: #8C1127;          /* Dark Maroon */
    --primary-light: #E63956;         /* Bright Rose */
    --primary-subtle: #FDF2F4;        /* Soft Crimson Tint */
    
    --accent-gold: #D4AF37;           /* Royal Metallic Gold */
    --accent-gold-dark: #AA8B22;      
    --accent-gold-light: #FFFBF0;     
    
    /* Neutrals & Surfaces */
    --bg-page: #F8FAFC;               /* Clean Off-White Canvas */
    --bg-card: #FFFFFF;               /* Solid White Elevation */
    --bg-surface-subtle: #F1F5F9;
    --bg-sidebar: #FFFFFF;
    --bg-footer: #0F172A;             /* Slate Dark Night */
    
    /* Typography Palette */
    --text-main: #0F172A;             /* Dark Navy/Slate */
    --text-muted: #64748B;            /* Muted Neutral Gray */
    --text-subtle: #94A3B8;           /* Subtle Placeholder Gray */
    --text-white: #FFFFFF;
    
    /* Functional Status Signals */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --info: #3B82F6;
    --info-bg: #EFF6FF;

    /* Structural Elevation & Borders */
    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;
    
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 30px -10px rgba(200, 30, 61, 0.18);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    
    /* Radii & Spacing */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --sidebar-width: 270px;
    --topbar-height: 70px;
    --bottom-nav-height: 64px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
   2. GLOBAL RESET & BASE STYLES
   ===================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-page);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

main.main-wrapper {
    flex: 1 0 auto;
    width: 100%;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5em;
    letter-spacing: -0.015em;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.975rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol { list-style: none; }

/* Legacy Blob Disabler */
.blob-bg { display: none !important; }

/* =====================================================================
   3. BUTTONS, BADGES & INTERACTIVE ELEMENTS
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    transition: all var(--transition-normal);
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white) !important;
    box-shadow: 0 8px 20px -4px rgba(200, 30, 61, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 12px 25px -2px rgba(200, 30, 61, 0.45);
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold), #B8860B);
    color: var(--text-white) !important;
    box-shadow: 0 8px 20px -4px rgba(212, 175, 55, 0.35);
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -2px rgba(212, 175, 55, 0.5);
}

.btn-outline {
    background: #FFFFFF;
    border: 2px solid var(--border-color);
    color: var(--text-main) !important;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
    background: var(--primary-subtle);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white) !important;
}
.btn-danger:hover { background: #DC2626; }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; display: flex; }

/* Badges & Chips */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-gold { background: var(--accent-gold-light); color: var(--accent-gold-dark); border: 1px solid rgba(212, 175, 55, 0.3); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* =====================================================================
   4. FORM CONTROLS & WIZARD INPUTS
   ===================================================================== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-input, .form-select, textarea.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    font-family: inherit;
    font-size: 0.925rem;
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, textarea.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 30, 61, 0.12);
}

.form-input::placeholder { color: var(--text-subtle); }

.form-error-msg {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
    display: block;
}

/* Custom Checkboxes & Radio Cards */
.radio-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.radio-card {
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    text-align: center;
}

.radio-card input:checked + .radio-card-label {
    border-color: var(--primary);
    background: var(--primary-subtle);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* =====================================================================
   5. CARDS, CONTAINERS & GRID LAYOUTS
   ===================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.card, .glass-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 28px;
    backdrop-filter: none !important;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
    border-color: var(--border-hover) !important;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* =====================================================================
   6. PUBLIC HEADER & NAVIGATION
   ===================================================================== */
.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 80%; max-width: 320px;
    background: #FFFFFF;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    padding: 24px;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.drawer-sidebar.open { transform: translateX(0); }

.drawer-close-btn {
    background: none; border: none;
    font-size: 24px; float: right;
    color: var(--text-muted); cursor: pointer;
}

.desktop-public-header { display: none; }

@media (min-width: 1024px) {
    .mobile-topbar { display: none !important; }
    
    .desktop-public-header {
        display: flex;
        position: sticky; top: 0; z-index: 40;
        align-items: center; justify-content: space-between;
        padding: 16px 48px;
        background: #FFFFFF;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-xs);
    }
    .desktop-public-header a.brand {
        display: flex; align-items: center; gap: 10px;
    }
    .desktop-public-header .links {
        display: flex; gap: 32px; align-items: center;
    }
    .desktop-public-header .links a {
        color: var(--text-main); font-weight: 600; font-size: 0.95rem;
    }
    .desktop-public-header .links a:hover {
        color: var(--primary);
    }
}

/* Bottom App Navigation Bar */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 50;
    height: var(--bottom-nav-height);
    display: flex; justify-content: space-around; align-items: center;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.7rem; color: var(--text-muted);
    gap: 4px; font-weight: 500;
}
.bottom-nav a.active, .bottom-nav a:hover {
    color: var(--primary); font-weight: 700;
}

@media (min-width: 1024px) {
    .bottom-nav { display: none !important; }
}

/* =====================================================================
   7. PUBLIC HOMEPAGE & HERO SECTION
   ===================================================================== */
.hero-wrapper {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    padding: 60px 0 80px;
    border-bottom: 1px solid var(--border-color);
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 48px;
    align-items: center;
}

.hero-title {
    font-size: 2.75rem;
    color: var(--text-main);
    line-height: 1.15;
    margin-bottom: 16px;
}

.search-strip-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
}

/* =====================================================================
   8. FOOTER STYLING
   ===================================================================== */
.site-footer {
    background: var(--bg-footer);
    color: #94A3B8;
    padding: 60px 20px 40px;
    margin-top: auto;
    border-top: 1px solid #1E293B;
}

.site-footer a {
    color: #CBD5E1;
    font-size: 0.9rem;
}
.site-footer a:hover { color: #FFFFFF; }

.site-footer-title {
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* =====================================================================
   9. MEMBER DASHBOARD & SIDEBAR LAYOUT
   ===================================================================== */
.desktop-sidebar { display: none; }

@media (min-width: 1024px) {
    .desktop-sidebar {
        display: block;
        position: fixed; top: 0; left: 0; bottom: 0;
        width: var(--sidebar-width);
        background: var(--bg-sidebar);
        border-right: 1px solid var(--border-color);
        overflow-y: auto; z-index: 30;
        padding: 24px 16px;
    }
    .desktop-topbar {
        position: fixed; top: 0; left: var(--sidebar-width); right: 0;
        height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between;
        padding: 0 32px; background: #FFFFFF;
        border-bottom: 1px solid var(--border-color); z-index: 29;
    }
    .main-content {
        margin-left: var(--sidebar-width);
        padding: 94px 32px 40px;
        max-width: 1440px;
    }
}

.main-content {
    padding: 20px 16px calc(var(--bottom-nav-height) + 20px);
}

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
    margin-bottom: 4px; transition: all var(--transition-fast);
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* Profile Completion Bar */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-surface-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--primary));
    transition: width 0.4s ease;
}

/* =====================================================================
   10. DISCOVER MATCHES & TINDER-SWIPE DECK (MODULE 5)
   ===================================================================== */
.swipe-deck-wrapper {
    max-width: 420px;
    height: 560px;
    margin: 0 auto;
    position: relative;
}

.match-card {
    position: absolute; inset: 0;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    user-select: none;
    cursor: grab;
    display: flex;
    flex-direction: column;
}
.match-card:active { cursor: grabbing; }

.match-card-img-wrapper {
    position: relative;
    height: 380px;
    width: 100%;
    overflow: hidden;
}

.match-card-img {
    width: 100%; height: 100%; object-fit: cover;
}

.match-card-blur {
    filter: blur(16px);
    transform: scale(1.05);
}

.match-card-badge {
    position: absolute; top: 16px; right: 16px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #FFFFFF; padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 700;
}

.match-card-info {
    padding: 18px 20px;
    flex: 1; display: flex; flex-direction: column; justify-content: space-between;
}

.swipe-actions-bar {
    display: flex; justify-content: center; gap: 24px;
    margin-top: 24px;
}

.swipe-btn {
    width: 58px; height: 58px; border-radius: 50%;
    border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 22px;
    box-shadow: var(--shadow-md); transition: transform var(--transition-fast);
}
.swipe-btn:active { transform: scale(0.9); }
.swipe-btn-pass { background: #FFFFFF; color: var(--danger); border: 2px solid var(--border-color); }
.swipe-btn-like { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #FFFFFF; }

/* =====================================================================
   11. GUNA MILAN (ASHTAKOOT) COMPONENT (MODULE 6)
   ===================================================================== */
.guna-milan-score-card {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, #0F172A, #1E293B);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

.guna-score-circle {
    width: 110px; height: 110px; border-radius: 50%;
    border: 4px solid var(--accent-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.25rem; font-weight: 800; color: var(--accent-gold);
    margin: 0 auto 16px;
}

.koota-breakdown-table {
    width: 100%; border-collapse: collapse; margin-top: 20px;
}

.koota-breakdown-table th, .koota-breakdown-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* =====================================================================
   12. PREMIUM CHAT INTERFACE (MODULE 7)
   ===================================================================== */
.chat-app-wrapper {
    display: flex;
    height: calc(100vh - 140px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #FFFFFF;
}

.chat-users-list {
    width: 320px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--bg-page);
}

.chat-user-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: background var(--transition-fast);
}
.chat-user-item:hover, .chat-user-item.active { background: #FFFFFF; }

.chat-thread-container {
    flex: 1; display: flex; flex-direction: column; background: #FFFFFF;
}

.chat-thread-messages {
    flex: 1; padding: 24px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
}

.chat-bubble {
    max-width: 68%; padding: 12px 18px;
    border-radius: 18px; font-size: 0.925rem; line-height: 1.5;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #FFFFFF; border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg-surface-subtle);
    color: var(--text-main); border-bottom-left-radius: 4px;
}

.chat-input-bar {
    padding: 16px 20px; border-top: 1px solid var(--border-color);
    display: flex; gap: 12px; align-items: center;
}

/* =====================================================================
   13. ADMIN PANEL SHELL (MODULE 9)
   ===================================================================== */
.admin-table {
    width: 100%; border-collapse: collapse; margin-top: 16px;
}

.admin-table th {
    background: var(--bg-surface-subtle);
    padding: 12px 16px; text-align: left;
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase;
}

.admin-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem; color: var(--text-main);
}

/* =====================================================================
   14. RESPONSIVE BREAKPOINTS
   ===================================================================== */
@media (max-width: 1023px) {
    body { padding-bottom: var(--bottom-nav-height); }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .hero-wrapper { padding: 40px 0 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .search-strip-card { padding: 20px; }
    .site-footer { padding-bottom: 40px; }
    .chat-app-wrapper { flex-direction: column; height: auto; }
    .chat-users-list { width: 100%; max-height: 220px; }
}