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

:root {
    /* Brand Colors */
    --primary: #f97316;    /* Vibrant Orange */
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.3);
    
    --secondary: #001f3f;  /* Classic Navy Blue */
    --secondary-hover: #00162d;
    --secondary-glow: rgba(0, 31, 63, 0.2);
    
    /* Backgrounds */
    --bg-color: #ffffff;
    --bg-surface: #f9fafb;
    --bg-surface-hover: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 31, 63, 0.1);
    
    /* Text */
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #ffffff;
    
    /* Borders & Accents */
    --border-color: #e5e7eb;
    --accent-orange: rgba(249, 115, 22, 0.1);
    --accent-navy: rgba(0, 31, 63, 0.1);
    
    /* Status */
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;

    /* Design System */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px var(--primary-glow);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
::placeholder { color: var(--text-muted); opacity: 0.7; }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--secondary); font-weight: 700; line-height: 1.2; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--text-muted); }

/* Spacing Helpers */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-6 { padding: 1.5rem; }
.pt-4 { padding-top: 1rem; }
.text-right { text-align: right; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }

/* Layout Utilities */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Navbar */
.navbar {
    background-color: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 4px 30px rgba(0, 31, 63, 0.05);
}

.navbar-inner { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { font-size: 1.8rem; font-weight: 800; color: var(--secondary); display: flex; align-items: center; gap: 0.75rem; }
.navbar-brand span { color: var(--primary); }
.navbar-search { flex: 1; max-width: 500px; margin: 0 3rem; position: relative; }
.navbar-search input { width: 100%; padding: 0.75rem 1.25rem 0.75rem 3rem; border-radius: var(--radius-full); border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); transition: var(--transition); }
.navbar-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--accent-orange); outline: none; }
.navbar-nav { display: flex; align-items: center; gap: 2rem; }
.navbar-actions { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { font-weight: 600; color: var(--text-muted); }
.nav-link:hover, .nav-link.active { color: var(--secondary); }

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #002d5c 100%);
    padding: 8rem 0;
    color: white;
    text-align: center;
    position: relative;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    margin-bottom: 4rem;
}

.hero-title { color: white; font-size: 4rem; margin-bottom: 1.5rem; }
.hero-subtitle { color: rgba(255, 255, 255, 0.8); font-size: 1.4rem; max-width: 800px; margin: 0 auto 3rem; }

.hero-search {
    background: white;
    padding: 0.6rem;
    border-radius: var(--radius-full);
    display: flex;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
}

.hero-search input { flex: 1; border: none; padding: 0 1.5rem; font-size: 1.1rem; outline: none; color: var(--text-main); }

/* Components */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); background: var(--bg-surface); }
.card-body { padding: 1.5rem; }

.badge { display: inline-block; padding: 0.35rem 0.8rem; font-size: 0.75rem; font-weight: 700; border-radius: var(--radius-full); text-transform: uppercase; }
.badge-primary { background: var(--accent-orange); color: var(--primary); }
.badge-secondary { background: var(--accent-navy); color: var(--secondary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.6rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--bg-surface-hover); color: var(--secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--accent-navy); border-color: var(--secondary); }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; color: var(--secondary); margin-bottom: 0.5rem; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 4px var(--accent-orange); }

.checkbox-group { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; cursor: pointer; }
.checkbox-group input { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border-color); }

/* Marketplace Layout */
.marketplace-layout { display: grid; grid-template-columns: 280px 1fr; gap: 3rem; }
.filters-sidebar { position: sticky; top: 120px; height: fit-content; }
.filter-group { margin-bottom: 2.5rem; }
.filter-title { font-size: 1rem; margin-bottom: 1.25rem; border-left: 4px solid var(--primary); padding-left: 0.75rem; }

/* Listing Cards */
.listing-card { border: 2px solid var(--border-color); }
.listing-card:hover { border-color: var(--primary); }
.listing-image-wrap { height: 200px; overflow: hidden; position: relative; background: var(--bg-surface); }
.listing-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.listing-details { padding: 1.25rem; }
.listing-price { font-size: 1.4rem; font-weight: 800; color: var(--secondary); margin-bottom: 0.5rem; }
.listing-title { font-weight: 700; font-size: 1.1rem; color: var(--secondary); margin-bottom: 0.5rem; display: block; }
.listing-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }

/* Dashboard Specifics */
.shop-section { margin-bottom: 5rem; }
.shop-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.shop-profile { display: flex; align-items: center; gap: 1rem; }
.shop-logo-sm { width: 55px; height: 55px; border-radius: 50%; border: 3px solid #fff; box-shadow: var(--shadow-md); object-fit: cover; }
.products-scroll { display: flex; gap: 1.5rem; overflow-x: auto; padding: 1rem 0 2.5rem; scroll-behavior: smooth; }
.products-scroll::-webkit-scrollbar { height: 6px; }
.products-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
.product-card-sm { min-width: 280px; flex-shrink: 0; }

/* Category Icon */
.category-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.category-icon:hover { border-color: var(--primary); background: #fff; transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Product Display Page */
.ad-detail-layout { display: grid; grid-template-columns: 1fr 350px; gap: 2.5rem; }
.ad-gallery-main { width: 100%; height: 500px; background: var(--bg-surface); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem; border: 1px solid var(--border-color); }
.ad-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.ad-thumbnails { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.ad-thumb { width: 80px; height: 80px; border-radius: var(--radius-md); border: 2px solid transparent; cursor: pointer; transition: var(--transition); flex-shrink: 0; overflow: hidden; }
.ad-thumb.active { border-color: var(--primary); }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Cart Styling */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2.5rem; }
.cart-item { display: flex; padding: 1.5rem; border-bottom: 1px solid var(--border-color); }
.cart-item-img { width: 120px; height: 120px; border-radius: var(--radius-md); object-fit: cover; margin-right: 1.5rem; }
.cart-item-details { flex: 1; }
.cart-item-title { font-size: 1.2rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.5rem; }
.cart-item-price { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.cart-summary { position: sticky; top: 120px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 1rem; }

/* Auth Pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-surface); }
.auth-card { background: #fff; width: 100%; max-width: 450px; padding: 3rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); }
.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-title { font-size: 2rem; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; }
.auth-footer { text-align: center; margin-top: 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* Dashboard Sidebar */
.dashboard-layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 80px); }
.dashboard-sidebar { background: #ffffff; border-right: 1px solid var(--border-color); padding: 2rem 0; display: flex; flex-direction: column; }
.dashboard-nav { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem; }
.dashboard-nav-link { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: var(--radius-md); font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.dashboard-nav-link:hover { background: var(--bg-surface); color: var(--secondary); }
.dashboard-nav-link.active { background: var(--accent-orange); color: var(--primary); }

/* Footer */
.footer { background: var(--secondary); color: white; padding: 5rem 0 2.5rem; margin-top: 5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 4rem; }
.footer-brand { font-size: 2rem; color: white !important; margin-bottom: 1.5rem; display: block; }
.footer-desc { color: rgba(255, 255, 255, 0.7); max-width: 350px; margin-bottom: 1.5rem; }
.footer h4 { color: white; margin-bottom: 1.5rem; font-size: 1.2rem; }
.footer-links a { color: rgba(255, 255, 255, 0.6); transition: var(--transition); display: block; margin-bottom: 0.75rem; }
.footer-links a:hover { color: var(--primary); transform: translateX(5px); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 4rem; padding-top: 2rem; display: flex; justify-content: space-between; color: rgba(255, 255, 255, 0.4); font-size: 0.85rem; }

/* Active State for Tabbed Navigation */
.active-tab {
    border-color: var(--primary) !important;
    background: var(--accent-orange) !important;
    color: var(--primary) !important;
    box-shadow: 0 4px 15px rgba(255, 126, 0, 0.15) !important;
}

/* Mobile Components (Hidden on Desktop) */
.mobile-nav, .public-mobile-popup, .seller-mobile-popup { display: none; }

/* Animation */
@media (max-width: 768px) {
    .marketplace-layout, .dashboard-layout, .cart-layout, .ad-detail-layout { grid-template-columns: 1fr !important; }
}

/* Animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.card, .shop-section, .auth-card { animation: fadeIn 0.6s ease-out backwards; }

/* ========================================================
   Modern OTP Verification Styles (Buyer & Seller)
   ======================================================== */
.otp-badge-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent-orange);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.12);
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.otp-badge-icon.seller-theme {
    background: #fef3c7;
    color: #b45309;
    box-shadow: 0 0 0 8px rgba(217, 119, 6, 0.15);
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.12); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(249, 115, 22, 0.22); }
}

.email-highlight {
    color: var(--secondary);
    font-weight: 700;
    word-break: break-all;
    background: var(--bg-surface-hover);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 1px solid var(--border-color);
    margin-top: 4px;
}

.otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 2rem 0;
}

.otp-digit {
    width: 52px;
    height: 62px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.otp-digit:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--accent-orange), var(--shadow-md);
    transform: translateY(-2px);
}

.seller-theme-inputs .otp-digit:focus {
    border-color: var(--warning);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2), var(--shadow-md);
}

.otp-digit.filled {
    border-color: var(--secondary);
    background: #ffffff;
}

.otp-digit.error {
    border-color: var(--danger) !important;
    background: #fff5f5 !important;
    animation: shakeBox 0.4s ease-in-out;
}

@keyframes shakeBox {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.otp-resend-box {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.resend-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
    transition: var(--transition);
}

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

.resend-link.seller-theme {
    color: #b45309;
}
.resend-link.seller-theme:hover {
    color: #92400e;
}

.btn-back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-back-link:hover {
    color: var(--secondary);
}

.view-transition {
    animation: viewFadeSlide 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes viewFadeSlide {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.otp-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: otpSpin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.otp-spinner.dark {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000000;
}

@keyframes otpSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .otp-inputs-wrapper {
        gap: 6px;
    }
    .otp-digit {
        width: 42px;
        height: 52px;
        font-size: 1.3rem;
    }
}