/* public/css/style.css */

/* --- Global & Typography --- */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8f9fa;
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #343a40;
}

a {
    color: #0d6efd;
    text-decoration: none;
}

a:hover {
    color: #0a58ca;
}

/* --- Main Layout Structure --- */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    /* Needed for the mobile overlay */
}

/* --- Sidebar Styling --- */
/* --- Sidebar Styling --- */
.sidebar {
    width: 280px;
    /* Slightly wider for better readability */
    min-width: 280px;
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    bottom: 0;
    z-index: 1000;
    /* Professional Gradient Background */
    background: linear-gradient(180deg, #1a252f 0%, #2c3e50 100%);
    color: #ecf0f1;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    /* Softer shadow */
    transition: margin-inline-start 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smoother bezier */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Cleaner font */
}

.main {
    flex-grow: 1;
    margin-inline-start: 280px;
    /* Match sidebar width */
    transition: margin-inline-start 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.content-wrapper {
    padding: 1.5rem;
    /* Add spacing around the content */
    width: 100%;
}

/* --- THE CORE TOGGLE LOGIC (Desktop) --- */
.wrapper.sidebar-toggled .sidebar {
    margin-inline-start: -280px;
}

.wrapper.sidebar-toggled .main {
    margin-inline-start: 0;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem;
    font-size: 1.4rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 0.5px;
}

.sidebar-brand a {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-close {
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0.5rem;
    line-height: 1;
}

.sidebar-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.sidebar-nav {
    padding: 1rem 0;
    list-style: none;
}

.sidebar-header {
    padding: 1.25rem 1.75rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f8c8d;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    /* Align icon and text */
    align-items: center;
    padding: 0.85rem 1.75rem;
    color: #bdc3c7;
    /* Softer white for inactive */
    transition: all 0.2s ease-in-out;
    border-inline-start: 4px solid transparent;
    /* Highlight marker */
    font-weight: 500;
}

/* Hover effect */
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding-inline-end: 2rem;
    /* Subtle slide effect */
}

/* Active State */
.sidebar-item.active>.sidebar-link {
    background: rgba(52, 152, 219, 0.15);
    /* Light blue tint */
    color: #fff;
    border-inline-start-color: #3498db;
    /* Blue accent border */
}

.sidebar-link i {
    width: 24px;
    /* Fixed width for icon alignment */
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.sidebar-link:hover i {
    transform: scale(1.1);
    /* Subtle icon pop */
}

/* --- Navbar --- */
.navbar-bg {
    background: #ffffff;
    border-bottom: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    z-index: 50;
    position: sticky;
    top: 0;
    padding: 0.75rem 1.5rem;
}

.sidebar-toggle {
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    color: #4e73df;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.sidebar-toggle:hover {
    background-color: #f8f9fc;
}

.navbar-align {
    margin-inline-start: auto;
}

.navbar-nav .nav-link {
    color: #858796;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover {
    color: #4e73df;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

/* --- Component & Auth Styles --- */
.card {
    border: none;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    border-radius: 0.75rem;
    /* Softer corners */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eaecf4;
    padding: 1rem 1.35rem;
    font-weight: 700;
    color: #4e73df;
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.auth-wrapper {
    background: #f0f2f5;
}

.card.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

/* Border accents */
.card.border-start-primary {
    border-left-width: 0 !important;
    border-right: 0.25rem solid #4e73df !important;
}

.card.border-start-success {
    border-left-width: 0 !important;
    border-right: 0.25rem solid #1cc88a !important;
}

.card.border-start-info {
    border-left-width: 0 !important;
    border-right: 0.25rem solid #36b9cc !important;
}

.card.border-start-warning {
    border-left-width: 0 !important;
    border-right: 0.25rem solid #f6c23e !important;
}

.card.border-start-danger {
    border-left-width: 0 !important;
    border-right: 0.25rem solid #e74a3b !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 0.35rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(78, 115, 223, 0.4);
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #1cc88a;
    border-color: #1cc88a;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(28, 200, 138, 0.4);
}

.btn-success:hover {
    background-color: #17a673;
    border-color: #169b6b;
    transform: translateY(-1px);
}

/* Inputs */
.form-control {
    border-radius: 0.35rem;
    padding: 0.6rem 1rem;
    border: 1px solid #d1d3e2;
}

.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}


/* --- NEW: Overlay for Mobile Sidebar --- */
.wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    visibility: hidden;
    transition: background 0.35s ease-in-out, visibility 0.35s;
}

/* --- RESPONSIVE OVERRIDES --- */
@media (max-width: 991.98px) {
    .sidebar {
        margin-inline-start: -280px;
    }

    .main {
        margin-inline-start: 0;
        width: 100%;
    }

    .wrapper.sidebar-toggled .sidebar {
        margin-inline-start: 0;
    }

    .wrapper.sidebar-toggled::after {
        background: rgba(0, 0, 0, 0.4);
        visibility: visible;
    }
}