/* --- CORE SETUP --- */
:root { 
    --primary: #16a34a; 
    --primary-hover: #15803d;
    --dark-green: #14532d;
    --bg: #f8fafc; 
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background: var(--bg); color: var(--text-main); }

/* Global animations and consistency */
* { transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.fade-in-up { animation: fadeInUp .4s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Remove arrow indicators in buttons/icons across pages */
.arrow-icon { display: none !important; }

/* Dark mode (user + admin pages) */
html.dark-mode body,
body.dark-mode {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}
body.dark-mode .main-header,
body.dark-mode header,
body.dark-mode .settings-card,
body.dark-mode .sell-card,
body.dark-mode .announcement-card,
body.dark-mode .chat-sidebar,
body.dark-mode .order-card,
body.dark-mode .product-card,
body.dark-mode .stat-card,
body.dark-mode .card,
body.dark-mode footer {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}
body.dark-mode .brand-title,
body.dark-mode .section-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #f8fafc !important;
}

/* --- AUTH SCREENS (Login & Register) --- */
.auth-wrapper { 
    display: flex; justify-content: center; align-items: center; 
    min-height: 100vh; padding: 20px; background-color: #f0fdf4; 
}

.login-card { 
    background: var(--white); width: 100%; max-width: 360px; 
    padding: 32px; border-radius: 24px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); text-align: center; 
}

.brand-icon-circle { 
    background: var(--primary); color: white; width: 60px; height: 60px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    font-size: 20px; font-weight: 800; margin: 0 auto 12px; 
    box-shadow: 0 8px 15px rgba(22, 163, 74, 0.2);
}

.form-group { text-align: left; margin-bottom: 16px; width: 100%; }
label { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 6px; display: block; text-transform: uppercase; }

input { 
    width: 100%; padding: 12px 14px; border: 1.5px solid #f1f5f9; 
    border-radius: 12px; background: #f8fafc; font-size: 14px; 
    transition: all 0.2s ease; 
}

input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1); }

.btn-primary { 
    width: 100%; background: var(--primary); color: white; border: none; 
    padding: 14px; border-radius: 12px; font-weight: 700; cursor: pointer; 
}

/* --- GLOBAL HEADER --- */
.main-header { 
    position: sticky; top: 0; background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0,0,0,0.05); z-index: 1000; 
}

.nav-container { 
    max-width: 1200px; margin: 0 auto; padding: 12px 25px; 
    display: flex; justify-content: space-between; align-items: center; 
}

.brand-logo img { height: 28px; width: auto; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.nav-links a.active { color: var(--primary); }

.sell-link { background: var(--primary); color: white !important; padding: 8px 18px; border-radius: 10px; }

/* --- CONTENT GRID --- */
.content { max-width: 1200px; margin: 40px auto; padding: 0 25px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card { background: white; border-radius: 20px; border: 1px solid #f1f5f9; overflow: hidden; transition: 0.3s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.05); }
.img-placeholder { height: 180px; background: #f1f5f9; }
.card-body { padding: 20px; }

/* --- SPLASH PAGE STYLES --- */

.splash-wrapper {
    background: #f0fdf4; /* Light green background to match your theme */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.splash-content {
    text-align: center;
    animation: fadeInScale 1.2s ease-out;
}

.splash-logo img {
    height: 50px; /* Larger logo for the splash screen */
    width: auto;
    margin-bottom: 20px;
}

.splash-tagline {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 15px;
    opacity: 0.8;
}

/* Loading Dots Animation */
.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Animations */
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}


:root {
    --primary: #16a34a;
    --dark-green: #064e3b;
    --soft-bg: #f8fafc;
    --text-muted: #64748b;
}

.auth-page {
    margin: 0;
    background-color: white;
    height: 100vh;
}

.auth-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- VISUAL SIDE (LEFT) --- */
.auth-visual {
    flex: 1.2;
    background: linear-gradient(rgba(6, 78, 59, 0.8), rgba(6, 78, 59, 0.6)), 
                url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 8%;
    color: white;
}

.visual-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
}

.visual-content span { color: var(--primary); }

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* --- FORM SIDE (RIGHT) --- */
.auth-form-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.form-box {
    width: 100%;
    max-width: 400px;
}

h2 { font-size: 28px; font-weight: 800; color: var(--dark-green); margin-bottom: 8px; }
.subtitle { color: var(--text-muted); margin-bottom: 35px; font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.label-row { display: flex; justify-content: space-between; align-items: center; }
.forgot-link { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; }

input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 15px;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.btn-primary-new {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-primary-new:hover { background: var(--dark-green); transform: translateY(-2px); }

.form-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
}

.form-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }

/* Responsive for Mobile */
@media (max-width: 900px) {
    .auth-visual { display: none; }
}

/* --- HEADER STYLES --- */
.main-header {
    background: #ffffff;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* Logo Design matching Login Page */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon-circle-sm {
    width: 40px;
    height: 40px;
    background: #16a34a; /* Brand Green */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.brand-text-sm h3 {
    font-size: 18px;
    font-weight: 800;
    color: #064e3b;
    margin: 0;
}

.brand-text-sm p {
    font-size: 10px;
    color: #16a34a;
    font-style: italic;
    margin: 0;
}

/* Navigation Links */
.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: #16a34a;
}

/* User Avatar Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}

.user-role {
    font-size: 11px;
    color: #64748b;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.nav-menu {
    display: flex;
    gap: 20px; /* Reduced from 30px to accommodate more links */
}

.user-profile-link {
    transition: opacity 0.2s ease;
}

.user-profile-link:hover {
    opacity: 0.8;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
/* Ensure the background is the same soft green across all pages */
body.home-bg, body {
    background-color: #f0fdf4 !important;
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Standardized container so content doesn't jump left or right */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Standard Section Heading matching "Featured Items" */
.section-title {
    color: #064e3b;
    font-weight: 800;
    font-size: 28px;
    margin: 0;
}

/* Header Background & Alignment */
.main-header {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* The Green Underline/Active State */
.nav-menu a {
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    padding: 5px 0;
    position: relative;
}

.nav-menu a.active {
    color: #16a34a; /* Brand Green */
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #16a34a;
}

/* --- Global Reset & Layout --- */
body { 
    background-color: #f0fdf4; 
    margin: 0; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

.content { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 40px 20px; 
}

/* --- Shared Header Styles --- */
.main-header {
    background: white;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -15px; /* Adjust to align underline exactly across pages */
    left: 0;
    width: 100%;
    height: 3px;
    background: #16a34a;
    border-radius: 10px;
}

/* --- Home: Promo Banner --- */
.promo-banner {
    background: linear-gradient(135deg, #16a34a 0%, #064e3b 100%);
    border-radius: 24px;
    padding: 40px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    box-shadow: 0 15px 30px rgba(22, 163, 74, 0.2);
}

.badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
}

.btn-shop {
    background: white;
    color: #16a34a;
    padding: 14px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
    transition: 0.3s;
}

/* --- Home: Featured Items --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title { color: #064e3b; margin: 0; font-weight: 800; font-size: 24px; }

.view-all { color: #16a34a; font-weight: 700; text-decoration: none; }

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 25px; 
}

.product-card {
    background: white;
    border-radius: 22px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.04);
}

.img-container { 
    height: 220px; 
    background: #f8fafc; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.img-container img { width: 75%; height: auto; }

.product-info { padding: 20px; }

.category-tag { color: #16a34a; font-size: 11px; font-weight: 800; text-transform: uppercase; }

.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }

.price { font-weight: 800; font-size: 20px; color: #064e3b; }

.btn-details { 
    background: #f0fdf4; 
    color: #16a34a; 
    border: none; 
    padding: 10px 18px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
}

/* --- ENHANCED DASHBOARD STYLES --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-value { font-size: 24px; font-weight: 800; color: var(--primary-dark); display: block; }
.stat-label { font-size: 14px; color: var(--text-light); font-weight: 600; }

/* Status Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-success { background: #dcfce7; color: #15803d; }

/* Table Styling */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
th { text-align: left; padding: 12px; font-size: 13px; color: var(--text-light); border-bottom: 1px solid #eee; }
td { padding: 15px 12px; font-size: 14px; border-bottom: 1px solid #f8fafc; }

/* Admin panel + fixed headers: dark mode overrides inline greens (theme toggle uses html/body .dark-mode) */
html.dark-mode header .nav-link,
body.dark-mode header .nav-link {
    color: #94a3b8 !important;
}
html.dark-mode header .nav-link:hover,
html.dark-mode header .nav-link.active,
body.dark-mode header .nav-link:hover,
body.dark-mode header .nav-link.active {
    color: #4ade80 !important;
}
html.dark-mode .brand-name,
html.dark-mode .brand h1,
body.dark-mode .brand-name,
body.dark-mode .brand h1 {
    color: #f8fafc !important;
}
html.dark-mode .brand-tagline,
html.dark-mode .brand p,
body.dark-mode .brand-tagline,
body.dark-mode .brand p {
    color: #86efac !important;
}
html.dark-mode .user-name,
html.dark-mode .profile-name,
body.dark-mode .user-name,
body.dark-mode .profile-name {
    color: #e2e8f0 !important;
}
html.dark-mode .user-role,
body.dark-mode .user-role {
    color: #f87171 !important;
}
html.dark-mode .table-wrap,
html.dark-mode .filter-bar,
html.dark-mode .page-header > div[style*="box-shadow"],
body.dark-mode .table-wrap,
body.dark-mode .filter-bar {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}
html.dark-mode .big,
body.dark-mode .big {
    color: #86efac !important;
}
html.dark-mode a.stat-link.card,
body.dark-mode a.stat-link.card {
    background: #111827 !important;
    border-color: #334155 !important;
}
html.dark-mode th,
html.dark-mode td,
html.dark-mode .order-table th,
html.dark-mode .order-table td,
body.dark-mode th,
body.dark-mode td {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
html.dark-mode .theme-row,
html.dark-mode .settings-card h2,
html.dark-mode .settings-card h3,
body.dark-mode .theme-row {
    color: #e2e8f0 !important;
}
html.dark-mode .modal-card,
body.dark-mode .modal-card {
    background: #111827 !important;
    border-color: #334155 !important;
}
html.dark-mode .modal-top h3,
body.dark-mode .modal-top h3 {
    color: #f8fafc !important;
}
html.dark-mode .admin-page-title,
body.dark-mode .admin-page-title {
    color: #f8fafc !important;
}
html.dark-mode .notif-dropdown,
body.dark-mode .notif-dropdown {
    background: #111827 !important;
    border-color: #334155 !important;
}
html.dark-mode .notif-item,
body.dark-mode .notif-item {
    color: #e2e8f0 !important;
}
html.dark-mode .notif-btn,
body.dark-mode .notif-btn {
    background: #0b1220 !important;
    border-color: #334155 !important;
}