:root {
    /* Palette - High Energy Tech-Luxury */
    --primary: #FF2800;
    /* Ferrari Red */
    --primary-rgb: 255, 40, 0;
    --primary-hover: #CC2000;

    --secondary: #FF6700;
    /* Safety Orange */
    --secondary-rgb: 255, 103, 0;

    --accent: #FFD700;
    /* Gold */
    --success: #00E676;
    /* Vivid Green */
    --danger: #FF1744;
    /* Vivid Red */

    /* Backgrounds */
    --bg-body: #F4F4F5;
    /* Off-white Clean */
    --bg-card: #FFFFFF;
    --bg-dark: #09090b;
    /* Zinc 950 */
    --bg-dark-card: #18181b;
    /* Zinc 900 */

    /* Text */
    --text-main: #18181B;
    /* Zinc 900 */
    --text-muted: #71717A;
    /* Zinc 500 */
    --text-light: #F4F4F5;

    /* Borders & Effects */
    --border: #E4E4E7;
    /* Zinc 200 */
    --border-dark: #27272a;
    /* Zinc 800 */

    --radius: 4px;
    /* Tech/Sharp feel - Frontend Specialist Mandate */

    /* Deep Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-red: 0 10px 30px -10px rgba(255, 40, 0, 0.5);
    /* Glow effect */

    --font-main: 'Outfit', sans-serif;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    /* Apple-style */
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s var(--ease-out);
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 40, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 40, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 40, 0, 0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.text-primary {
    color: var(--primary);
}

.text-sm {
    font-size: 0.875rem;
}

.w-full {
    width: 100%;
}

/* Stagger & Animation Utilities */
.animate-in {
    animation: fadeInUp 0.6s var(--ease-out) forwards;
    opacity: 0;
    /* Init hidden */
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s var(--ease-out);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 40, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 40, 0, 0.5);
    /* Stronger glow */
}

.btn-primary.pulse {
    animation: pulseGlow 2s infinite;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

/* Cards (Product & General) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.product-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    background: #2a2a2a;
    /* Slightly lighter than card for contrast */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image covers area, might crop */
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.08);
}

.product-cat {
    text-transform: uppercase;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em;
    /* Fixed height for alignment */
    /* text-shadow removed for black text */
}

.product-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.card.no-hover {
    transform: none !important;
    box-shadow: var(--shadow);
    /* Keep original shadow */
}

.card.no-hover:hover {
    border-color: var(--border-dark);
    /* No glow */
}

/* Dark Mode Overrides for Buttons */
body.dark-mode .btn-outline {
    color: #eee;
    border-color: #444;
}

body.dark-mode .btn-outline:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s var(--ease-out);
    background: var(--bg-card);
    font-family: var(--font-main);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-warning {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.badge-danger {
    background: rgba(255, 23, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

/* --- DARK MODE (Dashboard) --- */
/* Elements inside dashboard will typically inherit full dark styling */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

body.dark-mode .card {
    background-color: var(--bg-dark-card);
    border-color: var(--border-dark);
}

body.dark-mode .form-input {
    background-color: #000;
    border-color: var(--border-dark);
    color: white;
}

body.dark-mode .sidebar {
    background: var(--bg-dark-card);
    border-right-color: var(--border-dark);
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-item.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* --- GRID LAYOUT (Products) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f0f0f0;
    position: relative;
    margin-bottom: 1rem;
}

.product-image-container img,
.product-image-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.card:hover .product-image-container img {
    transform: scale(1.05);
    /* Zoom effect */
}

/* Price Tag */
.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Chat Sidebar (Dashboard) */
.admin-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-dark-card);
    border-left: 1px solid var(--border-dark);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.open {
    right: 0;
}


/* --- TABLE IMAGES --- */
.table-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
    cursor: pointer;
    background: #222;
}

.table-thumb:hover {
    transform: scale(1.5);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    border: 2px solid var(--primary);
}

/* --- TABLES (Dashboard) --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}

th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

td {
    color: var(--text-light);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- MODALS --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: scaleIn 0.3s var(--ease-out);
}

.modal .card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

/* --- SIDEBAR FIXES --- */
/* --- SIDEBAR & LAYOUT --- */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-dark-card);
    border-right: 1px solid var(--border-dark);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dashboard-main {
    margin-left: 260px;
    /* Matched to sidebar width */
    padding: 40px;
    width: calc(100% - 260px);
    box-sizing: border-box;
    min-height: 100vh;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-muted);
    /* Fixed color */
    margin-bottom: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 40, 0, 0.1);
    color: var(--primary);
}

.nav-item i {
    width: 25px;
    margin-right: 10px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 40, 0, 0.1);
    color: var(--primary);
}

/* Main Content Wrapper */
.dashboard-main {
    margin-left: 260px;
    padding: 40px;
    width: calc(100% - 260px);
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        /* Collapsed width */
        padding: 20px 0;
    }

    .sidebar h2 {
        display: none;
        /* Hide Logo Text */
    }

    .nav-item {
        justify-content: center;
        padding: 15px 0;
    }

    .nav-item span {
        display: none;
        /* Hide Label */
    }

    .nav-item {
        font-size: 0;
        /* Hide text */
    }

    .nav-item i {
        margin: 0;
        font-size: 1.4rem;
        /* Larger icons */
    }

    .dashboard-main {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 20px;
    }
}

/* --- Dashboard Chat & Order Controls --- */
.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark-card);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-light);
}

.sidebar-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-header button:hover {
    color: var(--primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--bg-dark);
    /* Slightly darker than sidebar */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

/* Admin Message - Ferrari Red */
.msg.admin {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Client Message - Dark Grey */
.msg.client {
    background: #27272a;
    /* Zinc 800 */
    color: #eee;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    border: 1px solid var(--border-dark);
}

.msg small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.order-controls {
    padding: 15px;
    background: var(--bg-dark-card);
    border-bottom: 1px solid var(--border-dark);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.action-buttons button {
    width: 100%;
    padding: 10px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: filter 0.2s;
}

.action-buttons button:hover {
    filter: brightness(1.1);
}

.btn-approve {
    background: #16a34a;
    color: white;
}

/* Green */
.btn-ship {
    background: #2563eb;
    color: white;
}

/* Blue */
.btn-delivery {
    background: #8b5cf6;
    color: white;
}


/* Purple */
.btn-cancel {
    background: #dc2626;
    color: white;
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
    backdrop-filter: blur(2px);
}

/* Red */

.chat-input-area {
    padding: 15px;
    background: var(--bg-dark-card);
    border-top: 1px solid var(--border-dark);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: #09090b;
    border: 1px solid var(--border-dark);
    color: white;
    padding: 10px;
    border-radius: 4px;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-input-area button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}