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

:root {
    /* Color Palette - Premium Light Theme */
    --primary-color: #059669; /* Deep Emerald */
    --primary-dark: #047857;
    --primary-glow: rgba(5, 150, 105, 0.15);
    
    --bg-color: #f8fafc; /* Very light slate */
    --bg-gradient-1: rgba(5, 150, 105, 0.05);
    --bg-gradient-2: rgba(59, 130, 246, 0.04);
    
    --surface-color: rgba(255, 255, 255, 0.85); /* Frosted white */
    --surface-color-solid: #ffffff;
    --surface-hover: rgba(248, 250, 252, 0.9);
    
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    
    --danger: #e11d48;
    --warning: #d97706;
    --success: #059669;
    --info: #2563eb;
    
    --border-color: rgba(15, 23, 42, 0.08); /* Slate border */
    --border-highlight: rgba(15, 23, 42, 0.15);
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08);
    --shadow-glow: 0 4px 15px var(--primary-glow);
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, var(--bg-gradient-1) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, var(--bg-gradient-2) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeUp 0.6s var(--transition) both;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.brand i {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-link i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    transition: transform var(--transition), color var(--transition);
}

.nav-link:hover i {
    transform: scale(1.15);
}

/* Dashboard Link - Indigo Blue */
.nav-link[href="index.php"] i { color: #2563eb; }
.nav-link[href="index.php"]:hover { background: rgba(37, 99, 235, 0.04); color: var(--text-main); }
.nav-link[href="index.php"].active {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border-left-color: #2563eb;
}

/* Vendors Link - Emerald Green */
.nav-link[href="vendors.php"] i { color: #10b981; }
.nav-link[href="vendors.php"]:hover { background: rgba(16, 185, 129, 0.04); color: var(--text-main); }
.nav-link[href="vendors.php"].active {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border-left-color: #10b981;
}

/* Markets Link - Amber/Orange */
.nav-link[href="markets.php"] i { color: #f59e0b; }
.nav-link[href="markets.php"]:hover { background: rgba(245, 158, 11, 0.04); color: var(--text-main); }
.nav-link[href="markets.php"].active {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border-left-color: #f59e0b;
}

/* Partnerships Link - Royal Violet */
.nav-link[href="partnerships.php"] i { color: #6366f1; }
.nav-link[href="partnerships.php"]:hover { background: rgba(99, 102, 241, 0.04); color: var(--text-main); }
.nav-link[href="partnerships.php"].active {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border-left-color: #6366f1;
}

/* Gardens Link - Sage Green */
.nav-link[href="gardens.php"] i { color: #16a34a; }
.nav-link[href="gardens.php"]:hover { background: rgba(22, 163, 74, 0.04); color: var(--text-main); }
.nav-link[href="gardens.php"].active {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
    border-left-color: #16a34a;
}

/* AI Assistant Link - Purple/Fuchsia */
.nav-link[href="assistant.php"] i { color: #a855f7; }
.nav-link[href="assistant.php"]:hover { background: rgba(168, 85, 247, 0.04); color: var(--text-main); }
.nav-link[href="assistant.php"].active {
    background: rgba(168, 85, 247, 0.08);
    color: #a855f7;
    border-left-color: #a855f7;
}

/* Reports Hub Link - Crimson Rose */
.nav-link[href="reports.php"] i { color: #ec4899; }
.nav-link[href="reports.php"]:hover { background: rgba(236, 72, 153, 0.04); color: var(--text-main); }
.nav-link[href="reports.php"].active {
    background: rgba(236, 72, 153, 0.08);
    color: #ec4899;
    border-left-color: #ec4899;
}

/* QR Generator Link - Cyan */
.nav-link[href="qr-generator.php"] i { color: #06b6d4; }
.nav-link[href="qr-generator.php"]:hover { background: rgba(6, 182, 212, 0.04); color: var(--text-main); }
.nav-link[href="qr-generator.php"].active {
    background: rgba(6, 182, 212, 0.08);
    color: #06b6d4;
    border-left-color: #06b6d4;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2.5rem 3.5rem;
    overflow-y: auto;
    position: relative;
}

.main-content > * {
    animation: fadeUp 0.5s var(--transition) both;
}
.main-content > *:nth-child(1) { animation-delay: 0.05s; }
.main-content > *:nth-child(2) { animation-delay: 0.1s; }
.main-content > *:nth-child(3) { animation-delay: 0.15s; }
.main-content > *:nth-child(4) { animation-delay: 0.2s; }

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

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--surface-color-solid);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(225, 29, 72, 0.1);
    color: var(--danger);
    border: 1px solid rgba(225, 29, 72, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

/* Cards & Glassmorphism Surfaces */
.card {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-lg);
}

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

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    overflow: hidden;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-block;
}

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

.stat-card:hover .stat-icon-wrapper {
    transform: scale(1.1);
}

.stat-icon-wrapper.success {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.stat-icon-wrapper.info {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.stat-icon-wrapper.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon-wrapper.danger {
    background: rgba(225, 29, 72, 0.1);
    color: #e11d48;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th, td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.03);
}

th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }

tbody tr {
    transition: background-color var(--transition), transform var(--transition);
}

tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
    transform: scale(1.005);
}

/* Status Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-danger {
    background: rgba(225, 29, 72, 0.1);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.2);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
    background: #ffffff;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    transition: opacity var(--transition);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface-color-solid);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: all var(--transition);
}

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

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--surface-color-solid);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(120%);
    transition: transform var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast-success .toast-icon { color: var(--success); }
.toast-info .toast-icon { color: var(--info); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-icon { font-size: 1.25rem; }
.toast-message { font-weight: 500; font-size: 0.95rem; }

/* Mobile Navigation */
.mobile-header {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 20;
    justify-content: space-between;
    align-items: center;
}

.mobile-header .brand {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition);
}

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

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 25;
    display: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Profile Specific */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--info));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    border: 4px solid var(--surface-color);
}

.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.profile-meta {
    color: var(--text-muted);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.tab:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-main);
}

.tab.active {
    background: var(--primary-glow);
    color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeUp 0.4s var(--transition);
}

.tab-content.active {
    display: block;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* Media Queries */
@media (max-width: 768px) {
    body { flex-direction: column; }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0; bottom: 0;
        width: 280px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 30;
    }
    
    .sidebar.active { left: 0; }
    
    .mobile-header { display: flex; }
    
    .main-content { padding: 1.5rem; }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .header-actions > div { width: 100%; }
    .header-actions input { width: 100% !important; }
    .btn { width: 100%; justify-content: center; }
    
    .stats-grid { grid-template-columns: 1fr; }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-header .header-actions { margin-left: 0 !important; }
    .profile-meta { justify-content: center; }
    
    .tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
}
