@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;700&display=swap');

:root {
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Heebo', sans-serif;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    direction: rtl;
    background-color: #f0f4f8;
    color: #333;
    display: flex;
    min-height: 100vh;
}

body.sidebar-open {
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    transition: transform var(--transition-speed) ease;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.sidebar-header img {
    max-height: 45px;
    max-width: 100%;
    margin-bottom: 8px;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    left: 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    z-index: 1040;
}

.sidebar-backdrop.active {
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #475569;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.sidebar-menu a i {
    margin-left: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Badge for Inbound Leads */
.badge-counter {
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 50px;
    margin-right: auto;
    font-weight: 700;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-navbar {
    min-height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    flex-wrap: wrap;
}

.navbar-start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-toggle-btn {
    display: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.user-role-label {
    font-size: 0.82rem;
    color: #64748b;
}

.btn-logout {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.btn-logout:hover {
    background: #fee2e2;
}

.content-body {
    padding: 24px;
    flex-grow: 1;
    min-width: 0;
}

.flash-messages-container {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-message-item {
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.flash-message-item button {
    background: none;
    border: none;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Dynamic Screen Background Tones (Glassmorphism Cards) */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* License Plate Component */
.license-plate {
    background-color: #facc15;
    border: 3px solid #1e293b;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 2px;
    color: #0f172a;
    display: inline-block;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 100%;
}

/* Tablets & Mobile Devices */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn,
    .sidebar-toggle-btn {
        display: inline-flex;
    }

    .top-navbar {
        padding: 10px 16px;
        min-height: 62px;
    }

    .content-body {
        padding: 16px;
    }
}

/* Small Smartphones */
@media (max-width: 600px) {
    .user-greeting {
        font-size: 0.88rem;
    }

    .user-role-label {
        display: none;
    }

    .btn-logout span {
        display: none;
    }

    .content-body {
        padding: 12px;
    }

    .glass-card {
        padding: 16px;
        border-radius: 12px;
    }

    .license-plate {
        font-size: 1rem;
        padding: 4px 10px;
        letter-spacing: 1px;
    }
}
