/* Custom CSS for Car Management Dashboard */

/* Import Vazir Font */
@font-face {
    font-family: 'Vazir'; /* نام دلخواه برای فونت */
    src: url('../fonts/Vazir-Medium.woff2') format('woff2'); /* مسیر فونت نسبت به فایل CSS */
    font-weight: 500; /* یا مقدار مناسب با وزن فونت */
    font-style: normal;
}
/* Vazir Light */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Light.woff2') format('woff2');
    font-weight: 300; /* Light */
    font-style: normal;
}

/* Vazir Medium */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Medium.woff2') format('woff2');
    font-weight: 500; /* Medium */
    font-style: normal;
}

/* Apply Vazir Font to all elements EXCEPT FontAwesome icons */
* {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif !important;
}

/* Preserve FontAwesome font-family for icons */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
}

/* Ensure FontAwesome icons display properly */
.fa-solid,
.fas {
    font-weight: 900;
}

.fa-regular,
.far {
    font-weight: 400;
}

.fa-brands,
.fab {
    font-weight: 400;
}

/* Improve font rendering for Vazir */
body {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Font weights for Vazir */
.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.font-black {
    font-weight: 900;
}

/* RTL Support */
[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button Animations */
.btn-animate {
    transition: all 0.2s ease;
}

.btn-animate:hover {
    transform: scale(1.05);
}

.btn-animate:active {
    transform: scale(0.95);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #22c55e;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Badge */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Sidebar Hover Effects */
.sidebar-link {
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #22c55e;
    transition: width 0.3s ease;
}

.sidebar-link:hover::before {
    width: 4px;
}

/* Form Input Focus Effects */
.input-focus {
    transition: all 0.3s ease;
}

.input-focus:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Table Row Hover */
.table-row-hover {
    transition: background-color 0.2s ease;
}

.table-row-hover:hover {
    background-color: #f0fdf4;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background-color: #fef2f2;
    color: #dc2626;
}

.status-repair {
    background-color: #fef3c7;
    color: #d97706;
}

.status-sold {
    background-color: #e0e7ff;
    color: #7c3aed;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
}

@media (min-width: 769px) {
    .desktop-hidden {
        display: none;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible for Keyboard Navigation */
.focus-visible:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card-hover:hover {
        border: 2px solid #22c55e;
    }
} 

/* --- Header & Sidebar Professional Styles --- */

/* Navbar gradient and shadow */
nav {
    box-shadow: 0 4px 24px 0 rgba(34,197,94,0.10), 0 1.5px 0 0 #bbf7d0;
    border-bottom-left-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
}

/* Sidebar gradient and shadow */
#sidebar {
    background: linear-gradient(180deg, #bbf7d0 0%, #fff 60%, #f0fdf4 100%);
    box-shadow: 0 8px 32px 0 rgba(34,197,94,0.10), 0 0.5px 0 0 #bbf7d0;
    border-top-right-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
}

/* Sidebar user info */
#sidebar .user-info {
    background: linear-gradient(90deg, #bbf7d0 0%, #fff 100%);
    border-radius: 1rem;
    box-shadow: 0 2px 8px 0 rgba(34,197,94,0.08);
}

/* Sidebar links */
.sidebar-link {
    font-size: 0.95rem; /* normalized to compact sizing across pages */
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 4px 0 rgba(34,197,94,0.04);
}
.sidebar-link:hover, .sidebar-link.bg-green-400\/80 {
    background: linear-gradient(90deg, #22c55e 60%, #bbf7d0 100%);
    color: #fff !important;
    box-shadow: 0 4px 16px 0 rgba(34,197,94,0.10);
}

/* Divider style */
#sidebar hr {
    border-color: #bbf7d0;
    opacity: 0.7;
}

/* Navbar user menu */
#userMenu {
    box-shadow: 0 8px 32px 0 rgba(34,197,94,0.10);
    border-radius: 1rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    nav {
        border-radius: 0 0 1.25rem 1.25rem;
    }
    #sidebar {
        border-radius: 0 1.25rem 1.25rem 0;
    }
}

/* Keep sidebar visible on scroll (desktop) */
@media (min-width: 768px) {
    #sidebar {
        position: sticky; /* remain in view during page scroll */
        top: 4.5rem; /* approximate navbar height */
        height: calc(100vh - 4.5rem);
        overflow-y: auto; /* scroll inside sidebar if needed */
    }
}

/* --- Compact Sidebar Enhancements --- */
/* Make sidebar slightly slimmer on desktop while keeping mobile full-width */
#sidebar {
    width: 12rem !important; /* enforce compact width (was 16rem) */
    flex: 0 0 12rem !important; /* ensure flex-basis follows width in flex layouts */
}

/* Compact link spacing, typography, and icon sizing */
#sidebar .sidebar-link {
    padding: 0.5rem 0.75rem; /* tighter spacing */
    font-size: 0.9rem; /* smaller text */
    border-radius: 0.75rem;
}

#sidebar .sidebar-link i {
    font-size: 0.95rem; /* tighter icon size */
}

/* Subtle active indicator and refined hover */
#sidebar .sidebar-link::before {
    width: 0; /* default hidden */
    transition: width 0.25s ease;
}
#sidebar .sidebar-link:hover::before {
    width: 2px; /* thinner accent bar on hover */
}

/* Stronger current/active state (when Tailwind active class applied) */
#sidebar .sidebar-link.bg-green-400\/80 {
    background: linear-gradient(90deg, #16a34a 60%, #bbf7d0 100%);
    box-shadow: 0 6px 18px 0 rgba(34,197,94,0.18);
}

/* Tighter divider spacing for compact menu */
#sidebar hr {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Keep mobile full width and comfortable tap targets */
@media (max-width: 768px) {
    #sidebar {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    #sidebar .sidebar-link {
        padding: 0.75rem 1rem;
        font-size: 1.05rem;
    }
} 

/* --- Collapsed Sidebar Mode (desktop) --- */
body.sidebar-collapsed #sidebar {
    width: 4.25rem !important; /* compact icon rail */
    flex: 0 0 4.25rem !important;
}
body.sidebar-collapsed #sidebar .px-4 { /* container paddings inside nav */
    padding-left: 0.5rem; /* LTR fallback */
    padding-right: 0.5rem; /* RTL primary */
}
body.sidebar-collapsed #sidebar .sidebar-link {
    padding: 0.625rem; /* square-ish icon buttons */
    justify-content: center;
}
body.sidebar-collapsed #sidebar .sidebar-link i {
    margin-left: 0 !important;
    font-size: 1.1rem;
}
body.sidebar-collapsed #sidebar .sidebar-link span {
    display: none; /* hide labels when collapsed */
}
body.sidebar-collapsed #sidebar hr { display: none; }

/* Keep user info hidden in collapsed mode */
body.sidebar-collapsed #sidebar .md\:flex { display: none; }

/* Main content should naturally expand due to flex; no extra margin needed */

/* Tooltips via title attribute will show on hover automatically */ 

/* HSE styles moved to assets/css/hse-styles.css to avoid cross-page conflicts */