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

/* ==========================================
   CSS VARIABLES & DESIGN SYSTEM
   ========================================== */
:root {
    /* Color Palette */
    --primary: #ff5e36;
    --primary-hover: #e54d27;
    --primary-gradient: linear-gradient(135deg, #ff5e36 0%, #ff8e53 100%);
    --secondary: #3b82f6;
    --secondary-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutral Colors */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Dark Theme Context */
    --dark-bg: #0b0f19;
    --dark-card: rgba(30, 41, 59, 0.7);
    --dark-border: rgba(255, 255, 255, 0.08);
    --dark-text: #f8fafc;

    /* Typography */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Shadows & Border Radius */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    /* Layout */
    --max-width: 1280px;
    --nav-height: 72px;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 54, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 94, 54, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 54, 0.4);
}

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

.btn-secondary:hover {
    background-color: var(--bg-app);
    transform: translateY(-2px);
}

.btn-dark {
    background-color: var(--text-main);
    color: white;
}

.btn-dark:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ==========================================
   HEADER & NAVBAR
   ========================================== */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-main);
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* User Profile Dropdown */
.profile-menu {
    position: relative;
    cursor: pointer;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.profile-avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1010;
}

.profile-dropdown.show {
    display: flex;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--bg-app);
    color: var(--primary);
}

/* ==========================================
   LANDING PAGE (HOME)
   ========================================== */
.hero-section {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 80px;
    background: radial-gradient(circle at 80% 20%, rgba(255, 94, 54, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    text-align: center;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.badge-tag {
    background-color: rgba(255, 94, 54, 0.1);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* VIP Products Showcase */
.showcase-section {
    padding: 80px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.2rem;
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 1.05rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 94, 54, 0.2);
}

.product-image-container {
    height: 220px;
    background-color: #f1f5f9;
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-featured {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: #ffb800;
    color: #0f172a;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.shop-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   MODAL DIALOG (LOGIN / REGISTER / RECOVERY)
   ========================================== */
dialog::backdrop {
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
}

.auth-dialog {
    border: none;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    margin: auto;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    background-color: var(--bg-card);
}

.dialog-header {
    background: var(--primary-gradient);
    color: white;
    padding: 30px 24px;
    position: relative;
}

.dialog-header h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.dialog-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.dialog-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dialog-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 16px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: rgba(255, 94, 54, 0.02);
}

.dialog-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* OAuth & Social Logins */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider:not(:empty)::before {
    margin-right: .5em;
}

.divider:not(:empty)::after {
    margin-left: .5em;
}

.btn-google {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    width: 100%;
    box-shadow: var(--shadow-sm);
    justify-content: center;
}

.btn-google img {
    width: 18px;
    height: 18px;
}

.btn-google:hover {
    background-color: var(--bg-app);
}

.helper-links {
    margin-top: 18px;
    text-align: center;
    font-size: 0.85rem;
}

.helper-links a {
    color: var(--primary);
    font-weight: 600;
}

.helper-links a:hover {
    text-decoration: underline;
}

/* ==========================================
   DASHBOARDS GENERAL LAYOUT
   ========================================== */
.dashboard-wrapper {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.sidebar-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.main-panel {
    min-height: 500px;
}

.user-profile-card {
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.big-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    color: white;
    font-size: 2.2rem;
    font-family: var(--font-heading);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 10px rgba(255, 94, 54, 0.2);
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 8px;
}

.role-client { background-color: rgba(59, 130, 246, 0.1); color: var(--secondary); }
.role-buyer { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.role-vip { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.role-admin { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Dashboard Cards and Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-top: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Alert Notification Boxes */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Orders List & Cards */
.order-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.order-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.order-id {
    font-weight: 700;
}

.status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending { background-color: #fef3c7; color: #d97706; }
.status-assigned { background-color: #e0f2fe; color: #0284c7; }
.status-in_progress { background-color: #e0e7ff; color: #4f46e5; }
.status-completed { background-color: #d1fae5; color: #059669; }
.status-cancelled { background-color: #fee2e2; color: #dc2626; }

.order-details p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

.order-cost {
    font-weight: 700;
}

/* Forms inside dashboards */
.dashboard-form-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

/* User management table (Admin) */
.table-responsive {
    overflow-x: auto;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th, td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

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

tr:last-child td {
    border-bottom: none;
}

/* Footer style */
footer {
    background-color: #0b0f19;
    color: #94a3b8;
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer p {
    font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-panel {
        margin-bottom: 20px;
    }
    .hero-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background-color: white;
        flex-direction: column;
        padding: 40px 24px;
        transition: left 0.3s ease;
        border-top: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-title {
        font-size: 2.3rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
