/* 
   Theme: Midnight Luxury
   Description: A premium dark theme for high-end car showrooms
*/

:root {
    /* Color Palette */
    --color-bg-dark: #0f172a;      /* Deep Blue/Black Background */
    --color-bg-card: #1e293b;      /* Slightly lighter for cards */
    --color-bg-sidebar: #020617;   /* Darkest for sidebar */
    
    --color-primary: #d4af37;      /* Metallic Gold */
    --color-primary-hover: #bfa030;
    --color-secondary: #94a3b8;    /* Muted Silver/Grey text */
    
    --color-text-main: #f8fafc;    /* White text */
    --color-text-muted: #64748b;   /* Muted text */
    
    --color-success: #10b981;      /* Emerald Green */
    --color-danger: #ef4444;       /* Red */
    --color-warning: #f59e0b;      /* Amber */
    
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.15); /* Gold Glow */
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--color-text-main);
    letter-spacing: -0.025em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--color-bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #f59e0b);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--color-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-primary);
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px; /* Arabic RTL */
    padding: 2rem; 
    width: calc(100% - 280px);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 1.875rem;
}

.page-title p {
    color: var(--color-secondary);
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding-left: 1rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
}

/* Cards */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(212, 175, 55, 0.3);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    color: var(--color-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* Grid System */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tables */
.table-container {
    background: var(--color-bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(0, 0, 0, 0.2);
    text-align: right;
    padding: 1rem 1.5rem;
    color: var(--color-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--color-text-main);
}

.table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-available { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-sold { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-reserved { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* RTL Specific Overrides for Arabic */
body {
    direction: rtl;
}

.sidebar {
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.main-content {
    margin-right: 280px;
    margin-left: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .sidebar { transform: translateX(100%); }
    .main-content { margin-right: 0; width: 100%; }
}
