@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables & Design System --- */
:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Curated Ayurvedic Forest Green & Sage Palette */
    --primary: hsl(135, 59%, 28%);
    --primary-hover: hsl(135, 59%, 20%);
    --primary-light: hsl(135, 59%, 93%);
    
    --secondary: hsl(88, 38%, 38%);
    --secondary-hover: hsl(88, 38%, 30%);
    --secondary-light: hsl(88, 38%, 93%);

    --accent: hsl(340, 82%, 55%);
    --accent-light: hsl(340, 82%, 96%);

    --success: hsl(142, 70%, 45%);
    --success-light: hsl(142, 70%, 95%);
    
    --warning: hsl(37, 90%, 50%);
    --warning-light: hsl(37, 90%, 95%);

    --danger: hsl(0, 84%, 60%);
    --danger-light: hsl(0, 84%, 95%);

    /* Neutrals */
    --bg-main: hsl(210, 40%, 98%);
    --bg-card: hsl(0, 0%, 100%);
    --text-dark: hsl(222, 47%, 12%);
    --text-medium: hsl(217, 19%, 35%);
    --text-light: hsl(215, 16%, 57%);
    --border-color: hsl(214, 32%, 91%);
    --border-focus: hsl(187, 85%, 42%);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-premium: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout Elements --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    padding: 2.5rem;
    overflow-y: auto;
    max-width: 100%;
}

/* --- Navigation & Header --- */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

.logo svg {
    width: 2rem;
    height: 2rem;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-medium);
    font-weight: 600;
    border-radius: var(--border-radius-md);
    transition: var(--transition-normal);
}

.nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
    stroke: none;
    flex-shrink: 0;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Admin specific clean text-only chevron links */
.nav-link.text-only {
    justify-content: space-between;
}

.nav-link.text-only::after {
    content: '›';
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-light);
    transition: all var(--transition-fast);
    line-height: 1;
}

.nav-link.text-only:hover::after, .nav-link.text-only.active::after {
    color: var(--primary);
    transform: translateX(3px);
}

.nav-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    background: var(--bg-main);
    margin-bottom: 1rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-role {
    color: var(--text-light);
    font-size: 0.75rem;
    text-transform: capitalize;
}

/* Public Header */
.public-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.public-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.public-menu-link {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
}

.public-menu-link:hover {
    color: var(--primary);
}

@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .public-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 6rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 105;
        border-left: 1px solid var(--border-color);
        list-style: none;
    }
    
    .public-menu.active {
        right: 0;
    }
    
    .public-menu li {
        width: 100%;
    }
    
    .public-menu li a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: var(--border-radius-sm);
        text-align: left;
    }
    
    .public-menu li a.btn {
        text-align: center;
    }
}

/* --- Components & Controls --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-medium);
}
.btn-outline:hover {
    background: var(--bg-main);
    color: var(--text-dark);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: hsl(0, 84%, 50%);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    position: relative;
    transition: var(--transition-normal);
    max-width: 100%;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition-normal);
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-approved, .badge-active {
    background: var(--success-light);
    color: var(--success);
}
.badge-rescheduled {
    background: var(--secondary-light);
    color: var(--secondary);
}
.badge-cancelled, .badge-inactive {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-completed {
    background: var(--primary-light);
    color: var(--primary);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-main);
    color: var(--text-medium);
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

.table-premium th, .table-premium td {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

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

.table tr:hover td {
    background-color: var(--primary-light);
}

/* Grid Boards */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.secondary { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.success { background: var(--success-light); color: var(--success); }

.stat-icon svg {
    width: 1.75rem;
    height: 1.75rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close-btn:hover {
    color: var(--text-dark);
}

/* --- Public Landing Page Layouts --- */
.hero-section {
    padding: 6rem 0;
    background: radial-gradient(circle at 80% 20%, var(--primary-light) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, var(--secondary-light) 0%, transparent 50%);
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-medium);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.services-section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title h2 {
    font-size: 2.25rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    text-align: center;
}

.service-icon {
    width: 4rem;
    height: 4rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.service-icon svg {
    width: 2rem;
    height: 2rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* --- Bottom Mobile Bar (Look like an App) --- */
.bottom-nav-bar {
    display: none;
}

.top-bar-mobile {
    display: none;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* Hide standard sidebar on smaller devices */
    }

    /* Show hamburger menu toggle or top header instead */
    .top-bar-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--bg-card);
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 99;
    }

    .top-bar-logo {
        font-family: var(--font-heading);
        font-weight: 800;
        font-size: 1.25rem;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .top-bar-logo svg {
        width: 1.5rem;
        height: 1.5rem;
        stroke: currentColor;
        stroke-width: 2.5;
        fill: none;
    }

    .main-content {
        padding: 1.5rem;
        padding-bottom: 80px; /* Leave space for bottom bar */
    }

    body {
        padding-bottom: 70px; /* Offset for mobile view bottom menu */
    }

    /* Mobile Bottom Navigation Menu */
    .bottom-nav-bar {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-light);
        font-size: 0.7rem;
        font-weight: 600;
        flex: 1;
        height: 100%;
        gap: 0.25rem;
        transition: var(--transition-fast);
    }

    .bottom-nav-item svg {
        width: 1.5rem;
        height: 1.5rem;
        fill: currentColor;
        stroke: none;
    }

    .bottom-nav-item:hover, .bottom-nav-item.active {
        color: var(--primary);
    }

    .hero-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .grid-stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.5rem;
    }
}

/* Helper utilities for responsive text swapping */
.mobile-text {
    display: none;
}
.desktop-text {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-text {
        display: inline;
    }
    .desktop-text {
        display: none;
    }
    .btn-sm {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
}

/* Timings marquee ticker for mobile screens */
.public-top-bar-marquee {
    display: flex;
    width: 100%;
}
.marquee-track {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding-right: 3rem;
    flex-shrink: 0;
}
.marquee-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .marquee-mobile-only {
        display: flex !important;
    }
    .public-top-bar {
        padding: 0.6rem 0 !important;
    }
    .public-top-bar .container {
        display: block !important;
        overflow: hidden;
        white-space: nowrap;
        position: relative;
        padding: 0 0.5rem !important;
    }
    .public-top-bar-marquee {
        width: max-content !important;
        justify-content: flex-start !important;
    }
    .marquee-track {
        animation: marqueeScroll 22s linear infinite;
    }
}
@keyframes marqueeScroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Premium Gradient Stats Cards */
.grid-stats-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.stat-card-gradient {
    border-radius: var(--border-radius-lg);
    padding: 1.75rem 2rem;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: none;
}

.stat-card-gradient:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.stat-card-gradient.blue {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}
.stat-card-gradient.purple {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
}
.stat-card-gradient.pink {
    background: linear-gradient(135deg, #be185d 0%, #ec4899 100%);
}
.stat-card-gradient.danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}
.stat-card-gradient.success {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}

.stat-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.stat-card-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.stat-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon i, .stat-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #ffffff !important;
    fill: none !important;
}

.stat-card-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 1.25rem;
}
