/* ===================================================
   COSMICA — Dashboard CSS  (White Minimalistic)
   =================================================== */

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

:root {
    --saffron: #FF9933;
    --saffron-dark: #E07B1A;
    --saffron-light: #FFF0DC;
    --purple: #6366F1;
    --purple-light: #EEF2FF;
    --blue: #3B82F6;
    --blue-light: #EFF6FF;
    --pink: #EC4899;
    --pink-light: #FDF2F8;
    --green: #22C55E;
    --green-light: #DCFCE7;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --bg-white: #FFFFFF;
    --bg-soft: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --sidebar-w: 260px;
    --topbar-h: 64px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --font-body: 'Inter', system-ui, sans-serif;
    --font-display: 'Cinzel', Georgia, serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-soft);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
    display: none;
}

.sidebar-overlay:not(.hidden) {
    display: block;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    position: relative;
}

.sidebar-link:hover {
    background: var(--bg-soft);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--saffron-light);
    color: var(--saffron-dark);
    font-weight: 600;
}

.sidebar-prime {
    background: linear-gradient(135deg, var(--saffron-light), #FDE8CC);
    color: var(--saffron-dark) !important;
    font-weight: 600 !important;
    border: 1px solid rgba(255, 153, 51, 0.2);
}

.sidebar-prime:hover {
    box-shadow: 0 2px 8px rgba(255, 153, 51, 0.2);
}

.sidebar-coming {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.sidebar-coming:hover {
    background: none !important;
}

.link-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.link-text {
    flex: 1;
}

.link-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.link-badge.live {
    background: var(--green-light);
    color: var(--green);
}

.link-badge.prime {
    background: var(--saffron-light);
    color: var(--saffron-dark);
}

.link-badge.coming {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.link-badge.soon {
    background: #FEF3C7;
    color: #92400E;
}

.app-soon-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #FEF3C7;
    color: #92400E;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

.app-card.maintenance {
    opacity: 0.75;
    background: #fdfdfd;
    cursor: not-allowed;
}

/* Sidebar Footer (User Info) */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-meta {
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.logout-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.15s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}

/* ===========================
   MAIN WRAPPER
   =========================== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   TOP BAR
   =========================== */
.topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.topbar-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.topbar-greeting {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.topbar-clock {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===========================
   DASHBOARD MAIN
   =========================== */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1100px;
    width: 100%;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--saffron) 0%, #E07B1A 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    overflow: hidden;
    position: relative;
}

.welcome-banner::before {
    content: 'ॐ';
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.08);
    font-family: var(--font-display);
    line-height: 1;
}

.welcome-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.4rem;
}

.welcome-text p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.welcome-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.25);
    flex-shrink: 0;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Section Heading */
.section-heading {
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.section-heading p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.app-card {
    background: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(10, 14, 26, 0.02);
    min-height: 245px;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(212, 175, 55, 0.06), 0 4px 12px rgba(10, 14, 26, 0.03);
    border-color: rgba(212, 175, 55, 0.35);
}

.app-card.maintenance {
    opacity: 0.75;
    background: #fdfdfd;
    cursor: not-allowed;
}

.app-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.app-icon {
    line-height: 1;
}

/* Custom Gradients for Icons */
.icon-horo { background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.02)); border: 1px solid rgba(168, 85, 247, 0.15); }
.icon-kunda { background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02)); border: 1px solid rgba(59, 130, 246, 0.15); }
.icon-prashn { background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.02)); border: 1px solid rgba(249, 115, 22, 0.15); }
.icon-match { background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(236, 72, 153, 0.02)); border: 1px solid rgba(236, 72, 153, 0.15); }
.icon-event { background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.02)); border: 1px solid rgba(20, 184, 166, 0.15); }
.icon-tarot { background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.02)); border: 1px solid rgba(212, 175, 55, 0.2); }

.app-card:hover .app-icon-wrapper {
    transform: scale(1.08);
}

.app-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem 0;
    transition: color 0.2s ease;
}

.app-card:hover h3 {
    color: var(--saffron-dark);
}

.app-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 0.85rem 0;
    flex-grow: 1;
}

.app-features {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.app-features .dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--border);
    vertical-align: middle;
    margin-left: 0.4rem;
}

.app-cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--saffron);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.app-card:hover .app-cta {
    color: var(--saffron-dark);
    transform: translateX(3px);
}

/* Info Section */
.info-section {
    margin-top: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem;
}

.info-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s;
}

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

.info-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.info-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===========================
   MODAL
   =========================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hidden {
    display: none !important;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--border);
}

.modal-header {
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-data-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pdata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.pdata-item span {
    color: var(--text-muted);
}

.pdata-item strong {
    color: var(--text-primary);
}

.profile-loading {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 1rem 0;
    text-align: center;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-modal-action {
    flex: 1;
    padding: 0.7rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}

.primary-action {
    background: var(--saffron);
    color: white;
}

.primary-action:hover {
    background: var(--saffron-dark);
}

.danger-action {
    background: #FEF2F2;
    color: #DC2626;
}

.danger-action:hover {
    background: #FEE2E2;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-menu {
        display: flex;
    }

    .app-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .app-prime {
        grid-column: span 1;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        padding: 1.5rem;
    }

    .welcome-logo {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 560px) {
    .dashboard-main {
        padding: 1.25rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }

    .topbar {
        padding: 0 1.25rem;
    }

    .topbar-clock {
        display: none;
    }

    .prashn-how {
        flex-direction: column;
    }
}