/**
 * Chef Optics - Main Stylesheet (Version 2.0)
 * A unified design system for both public marketing pages and the internal application.
 */

/* ===== 1. DESIGN TOKENS & BASE ===== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Colors */
    --primary: #27AE60;
    --primary-dark: #229954;
    --accent: #E67E22;
    --danger: #E74C3C;
    --warning: #F1C40F;
    --text-headings: #1F2937;
    --text-body: #4B5563;
    --text-muted: #6B7280;
    --bg-canvas: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;

    /* Fonts */
    --font-manrope: 'Manrope', sans-serif;
    --font-inter: 'Inter', sans-serif;

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

body {
    font-family: var(--font-inter);
    background-color: var(--bg-canvas);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-manrope);
    font-weight: 700;
    color: var(--text-headings);
}

/* ===== 2. UNIFIED BUTTONS ===== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: #D35400; /* Darker accent */
    border-color: #D35400;
    color: white;
}

.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-body);
    background-color: var(--bg-white);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-canvas);
    border-color: #D1D5DB;
    color: var(--text-headings);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== 3. PUBLIC NAVIGATION & FOOTER ===== */
.public-nav {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.public-nav .navbar-brand {
    font-family: var(--font-manrope);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-headings);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.public-nav .navbar-brand svg {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
}

.public-nav .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

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

.public-footer {
    background-color: var(--text-headings);
    color: var(--border-color);
    padding: 3rem 0;
}

.public-footer a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease-in-out;
}

.public-footer a:hover {
    color: white;
}

.public-footer h3 {
    font-family: var(--font-manrope);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: white;
}

/* ===== 4. LANDING PAGE SECTIONS ===== */
.hero-gradient {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(230, 126, 34, 0.08) 100%);
    padding: 6rem 0;
}

.hero-section h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 550px;
    margin-bottom: 2rem;
}

.dashboard-mockup {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease-in-out;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* How It Works Steps */
.how-it-works-step {
    position: relative;
    text-align: center;
}

.how-it-works-step:not(:last-child):after {
    content: '';
    position: absolute;
    top: 50%;
    right: -50px;
    width: 40px;
    height: 2px;
    background-color: var(--border-color);
}

@media (max-width: 768px) {
    .how-it-works-step:not(:last-child):after {
        display: none;
    }
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--primary);
    font-family: var(--font-manrope);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Trust Section */
.trust-section {
    background-color: rgba(39, 174, 96, 0.05);
}

.trust-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
}

.trust-card h2 {
    font-family: var(--font-manrope);
    font-weight: 700;
    color: var(--text-headings);
    margin-bottom: 1rem;
}

.trust-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.trust-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-feature svg {
    color: var(--primary);
    width: 1.25rem;
    height: 1.25rem;
}

.trust-feature span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-headings);
}

/* Final CTA Section */
.final-cta {
    background: var(--primary);
    border-radius: var(--radius-2xl);
    padding: 3rem;
}

.final-cta h2 {
    font-family: var(--font-manrope);
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.final-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
}

.cta-button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease-in-out;
}

.cta-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    text-decoration: none;
}

/* Logo Cloud */
.logo-cloud {
    background: var(--bg-white);
    padding: 2rem 0;
}

.logo-cloud p {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 3rem;
}

.logo-item img {
    height: 100%;
    opacity: 0.7;
    filter: grayscale(100%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.logo-item:hover img {
    opacity: 1;
    filter: grayscale(0%);
}

/* ===== 5. AUTH FORMS (Login/Register) ===== */
.auth-container {
    background-color: var(--bg-canvas);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25);
}

.password-strength .progress-bar {
    transition: width 0.3s ease;
}

.password-strength .weak {
    background-color: var(--danger);
}

.password-strength .fair {
    background-color: var(--warning);
}

.password-strength .good {
    background-color: #5DADE2;
}

.password-strength .strong {
    background-color: var(--primary);
}

/* ===== 6. DASHBOARD LAYOUT ===== */
.dashboard-main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.dashboard-main-wrapper.sidebar-collapsed {
    margin-left: 80px;
}

@media (max-width: 991.98px) {
    .dashboard-main-wrapper,
    .dashboard-main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }
}

/* Sidebar */
.sidebar-nav {
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    width: 260px;
    box-shadow: var(--shadow-md);
    transition: width 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
}

.sidebar-nav .navbar-brand {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav .navbar-brand i {
    margin-right: 0.75rem;
    color: var(--accent);
}

.sidebar-nav .navbar-brand .sidebar-label {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-headings);
}

.sidebar-nav .nav-link {
    color: var(--text-headings);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(230, 126, 34, 0.1);
    color: #D35400;
}

.sidebar-nav .nav-link.active {
    background-color: var(--accent);
    color: white;
    font-weight: 600;
}

.sidebar-nav.collapsed {
    width: 80px;
}

.sidebar-nav.collapsed .sidebar-label,
.sidebar-nav.collapsed .sidebar-group-label {
    display: none;
}

.sidebar-nav.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

/* Topbar */
.topbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== 7. CARDS & COMPONENTS ===== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease-in-out;
}

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

/* ===== 8. TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: var(--bg-canvas);
    font-weight: 600;
    color: var(--text-headings);
}

tr:nth-child(even) {
    background-color: var(--bg-canvas);
}

tr:hover {
    background-color: rgba(39, 174, 96, 0.05);
}

/* ===== 9. ALERTS & VALIDATION ===== */
.alert {
    border-radius: var(--radius-md);
    border: none;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    color: var(--danger);
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* ===== 10. UTILITY CLASSES ===== */
.text-headings {
    color: var(--text-headings);
}

.text-body {
    color: var(--text-body);
}

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

.font-manrope {
    font-family: var(--font-manrope);
}

.font-inter {
    font-family: var(--font-inter);
}

.bg-canvas {
    background-color: var(--bg-canvas);
}

/* ===== 11. RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .final-cta {
        padding: 2rem;
    }
    
    .final-cta h2 {
        font-size: 1.75rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

/* ===== 12. ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 13. HIDDEN ELEMENTS ===== */
.form-honeypot {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    pointer-events: none;
}

@media (min-width: 992px) {
  .sidebar-nav .sidebar-group-label {
    padding-left: 1.5rem !important;
  }
}

/* Add this to your main stylesheet or a <style> tag in topbar.php */
.topbar .dropdown-menu {
    z-index: 1050; /* Ensure it's above the banner but below modals */
}

/* Add this to your main stylesheet or a <style> tag in subscription_banner.php */
.subscription-banner-container { /* Assuming this is the class of your banner's outer div */
    position: relative; /* This is crucial for z-index to work */
    z-index: 100;       /* A low value, keeping it below dropdowns and modals */
}