/* * Global Frontend Stylesheet
 * 100% Responsive for Mobile, Tablet, Desktop
 */
:root {
    --primary-color: #007bff;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid #eaeaea; /* Clean, minimal border */
    border-radius: var(--border-radius);
    padding: 20px;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.product-price {
    font-weight: bold;
    color: var(--primary-color);
}

/* * Header & Navigation Styles 
 * Fully Responsive with Flexbox 
 */
.main-header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Clean alternative to bottom-border */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.btn-login {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-signup {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn-signup:hover {
    background-color: #0056b3;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
}

/* * Footer Styles 
 */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator, not a layout border */
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* * Responsive Media Queries 
 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: var(--card-bg);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        padding: 20px;
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
    }
}

/* * Dropdown Menu Styles 
 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
    z-index: 1000;
    padding: 10px 0;
}

/* Show dropdown on hover (Desktop) */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* Dropdown arrow icon */
.dropdown-toggle::after {
    content: ' \25BE'; /* Down arrow */
    font-size: 0.8em;
    margin-left: 5px;
}

/* * Mobile Dropdown Adjustments 
 */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none; /* Hidden by default on mobile, toggled via JS */
        background-color: #f8f9fa;
        padding: 0;
        margin-top: 10px;
        border-radius: 0;
    }
    
    .dropdown-menu.show {
        display: block;
    }

    .dropdown-item {
        padding: 10px 30px; /* Indent subcategories on mobile */
        border-left: 3px solid transparent;
    }
    
    .dropdown-item:hover {
        border-left-color: var(--primary-color);
    }
}

/* * Single Product Page Styles
 * Fully Responsive, Clean UI
 */
.product-details-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Desktop Layout: Left bigger, Right smaller */
    gap: 30px;
    padding: 40px 0;
}

/* Left Side: Gallery & Description */
.product-main {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-gallery {
    margin-bottom: 30px;
}

.main-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
    object-fit: cover;
    background-color: #f1f5f9;
}

.product-description h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.product-description p {
    color: #555;
    line-height: 1.8;
}

/* Right Side: Sidebar (Price & Actions) */
.product-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.purchase-card, .seller-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-price-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-buy-now {
    background-color: #10b981; /* Green for high conversion */
    color: #fff;
}

.btn-buy-now:hover { background-color: #059669; }

.btn-add-cart {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-add-cart:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-live-preview {
    background-color: #475569;
    color: #fff;
}

.btn-live-preview:hover { background-color: #334155; }

/* Seller Info & Stats */
.seller-card h3 { margin-bottom: 15px; font-size: 1.2rem; }
.stat-row { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #f1f5f9; padding-bottom: 5px; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .product-details-container {
        grid-template-columns: 1fr; /* Switch to 1 column on mobile/tablet */
    }
}

/* * Advanced Search Bar Styles
 * Clean, Responsive, and No heavy borders
 */
.search-container {
    flex-grow: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    position: relative;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Clean shadow instead of border */
    overflow: hidden;
}

.search-input {
    width: 100%;
    border: none;
    padding: 10px 15px 10px 20px;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-color);
    background: transparent;
}

.search-btn {
    background-color: transparent;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.search-btn:hover {
    transform: scale(1.1);
}

/* Responsive Adjustments for Search Bar */
@media (max-width: 992px) {
    .search-container {
        display: none; /* Hide in main navbar on mobile */
    }
    
    .mobile-search-container {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #eaeaea;
    }
}

@media (min-width: 993px) {
    .mobile-search-container {
        display: none;
    }
}

/* * Authentication Forms (Login & Register)
 * Clean, Responsive, Borderless UI
 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 15px;
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Soft shadow instead of border */
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
}

.auth-card p.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.role-selection {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.btn-auth:hover {
    background-color: #0056b3;
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    font-size: 0.95rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert-error {
    background-color: #fef2f2;
    color: #ef4444;
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background-color: #f0fdf4;
    color: #10b981;
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-left: 4px solid #10b981;
}

/* * User Dashboard Styles
 * Modern, Clean, and Borderless Layout
 */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar and Content Area */
    gap: 30px;
    padding: 40px 0;
}

/* Sidebar Navigation */
.dashboard-sidebar {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    height: fit-content;
}

.user-info-brief {
    text-align: center;
    margin-bottom: 30px;
}

.user-avatar-circle {
    width: 80px;
    height: 80px;
    background: var(--bg-color);
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.dash-nav {
    list-style: none;
}

.dash-nav-item a {
    display: block;
    padding: 12px 15px;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.dash-nav-item a:hover, .dash-nav-item a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Content Area */
.dashboard-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.welcome-banner {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

/* Table Style (For Purchases) */
.dash-table-container {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.dash-table th {
    text-align: left;
    padding: 12px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    background: #f8fafc;
}

.dash-table td {
    padding: 15px 12px;
    color: var(--text-color);
    border-bottom: 1px solid #f1f5f9; /* Minimal separator only */
}

/* Responsive Dashboard */
@media (max-width: 992px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }
}

/* * Checkout & Order Success Styles
 * Clean, Borderless, and Modern UI
 */
.checkout-wrapper {
    max-width: 900px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.checkout-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.order-summary-list {
    list-style: none;
    margin-top: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.total-row {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 15px;
    color: var(--primary-color);
}

.payment-methods {
    margin-top: 25px;
}

.payment-option {
    display: block;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.payment-option:hover { background: #f1f5f9; }

/* Success Page */
.success-card {
    text-align: center;
    padding: 60px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 600px;
    margin: 60px auto;
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .checkout-wrapper { grid-template-columns: 1fr; }
}

/* * Profile Settings Styles
 * Clean, Focus-driven, and Fully Responsive
 */
.profile-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

.settings-section {
    margin-bottom: 40px;
}

.settings-section h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9; /* Subtle section divider */
}

.input-helper {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 5px;
}

.btn-update {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-update:hover {
    opacity: 0.9;
}