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

/* --- CSS Variables & Design System --- */
:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Light Mode Constants */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-raw: 255, 255, 255;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-color-raw: 226, 232, 240;
    --primary-color: #635bff;
    --primary-hover: #4e46e5;
    --primary-light: rgba(99, 91, 255, 0.08);
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(226, 232, 240, 0.8);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
}

[data-bs-theme="dark"] {
    /* Dark Mode Constants */
    --bg-app: #0b0f19;
    --bg-card: #111827;
    --bg-card-raw: 17, 24, 39;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1f2937;
    --border-color-raw: 31, 41, 55;
    --primary-color: #635bff;
    --primary-hover: #7c75ff;
    --primary-light: rgba(99, 91, 255, 0.15);
    --secondary-color: #38bdf8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 20px 45px -12px rgba(0, 0, 0, 0.6);
    
    --glass-bg: rgba(11, 15, 25, 0.75);
    --glass-border: rgba(31, 41, 55, 0.8);
}

/* --- Base Resets & Layouts --- */
body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

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

/* --- Premium Buttons (Stripe / Apple Style) --- */
.btn {
    font-weight: 600;
    font-size: 0.925rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 91, 255, 0.25);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 91, 255, 0.35);
}
.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}
.btn-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text-main);
}
.btn-glass:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* --- Public Header & Navbar --- */
.navbar-custom {
    min-height: var(--header-height);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}
.navbar-custom .navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-custom .navbar-brand span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.navbar-custom .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}
.navbar-custom .nav-link:hover, .navbar-custom .nav-item.active .nav-link {
    color: var(--text-main);
    background-color: var(--primary-light);
}

@media (max-width: 991.98px) {
    .navbar-custom {
        padding: 0.75rem 0;
    }
    .navbar-collapse {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        padding: 1.5rem;
        margin-top: 0.75rem;
        box-shadow: var(--shadow-lg);
    }
    .navbar-nav {
        align-items: stretch;
        gap: 6px;
        margin-bottom: 1.25rem !important;
    }
    .navbar-nav .nav-link {
        width: 100%;
        padding: 0.65rem 1rem !important;
    }
    .navbar-custom .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100%;
    }
    .navbar-custom .d-flex .btn, .navbar-custom .d-flex a {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* --- Public Hero Section --- */
.hero-section {
    position: relative;
    padding: 120px 0 100px;
    background: radial-gradient(circle at 10% 20%, rgba(99, 91, 255, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.05) 0%, transparent 40%);
    overflow: hidden;
}
.hero-badge {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 24px;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}
.hero-title span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

/* --- Vercel/Linear Style Cards --- */
.premium-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
}
.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(var(--border-color-raw), 0.5);
}
.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.premium-card:hover::before {
    opacity: 1;
}

/* Featured Card Image Header */
.card-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: 1.25rem;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.premium-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

/* --- Progress Indicators --- */
.progress-container {
    margin: 1.25rem 0;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.progress-bar-custom {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 50px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 50px;
    width: 0;
    transition: width 1s ease-in-out;
}

/* --- Testimonials (Glassmorphism & Swiper) --- */
.swiper-testimonials {
    padding: 20px 20px 50px;
}
.testimonial-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
}
.testimonial-quote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 20px;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}
.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--border-color);
}
.testimonial-name {
    font-weight: 700;
    font-size: 0.95rem;
}
.testimonial-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Command Palette (CMD+K Search) --- */
.command-palette-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}
.command-palette-backdrop.active {
    display: flex;
}
.command-palette {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDownPalette 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.palette-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}
.palette-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-primary);
}
.palette-results {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
}
.palette-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    transition: background 0.15s ease;
    cursor: pointer;
}
.palette-result-item:hover, .palette-result-item.selected {
    background-color: var(--primary-light);
    color: var(--primary-color);
}
.palette-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}
[data-bs-theme="dark"] .palette-footer {
    background: rgba(255, 255, 255, 0.02);
}
.palette-key {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

@keyframes slideDownPalette {
    from {
        transform: translateY(-20px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* --- Theme Toggle Switcher Floating --- */
.theme-toggle-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    color: var(--text-main);
    transition: all 0.2s ease;
}
.theme-toggle-floating:hover {
    transform: scale(1.08);
}

/* --- Admin Panel Dashboard Styling --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}
.admin-sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.admin-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-menu-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 700;
}
.admin-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.admin-menu-link:hover, .admin-menu-link.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}
.admin-content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex items from breaking grid widths */
}
.admin-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}
.admin-main {
    padding: 2rem;
    flex: 1;
    background-color: var(--bg-app);
}

/* Stats Cards Vercel Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stats-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stats-card-val {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 4px 0;
    letter-spacing: -0.03em;
}
.stats-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.stats-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-sm);
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms (Notion/Stripe style input focus outlines) */
.form-control, .form-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.65rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: 0.925rem;
    transition: all 0.2s ease;
}
.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    color: var(--text-main);
}
label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

/* --- Media Library manager --- */
.media-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.media-item-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.media-item-preview {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-app);
}
.media-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-item-preview .file-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}
.media-item-info {
    padding: 6px 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    background: var(--bg-card);
}

/* --- Dynamic Skeleton Loader animation --- */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-app) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loadingSkeleton 1.5s infinite;
}
@keyframes loadingSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile responsive menu hamburger settings */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.mobile-active {
        transform: translateX(0);
    }
    .admin-content-wrapper {
        margin-left: 0;
    }
}
