/* frontend/assets/css/layout.css */

/* --- General Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-body, #f4f6f9);
    /* Fallback color added */
}

/* --- SIDEBAR (Professional & Colorful) --- */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #dfe6e9;
    /* Restored Border */
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    left: 0;
    top: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo Area */
.sidebar .sidebar-header {
    height: 80px;
    /* Taller header */
    min-height: 80px;
    display: flex;
    align-items: center;
    padding: 0 30px;
    background-color: #ffffff;
    border-bottom: 1px solid #dfe6e9;
    /* Restored Border */
}

.brand-logo {
    font-size: 26px;
    font-weight: 800;
    /* Gradient Text */
    background: linear-gradient(45deg, #6c5ce7, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.brand-logo i {
    margin-right: 12px;
    font-size: 30px;
    display: inline-block;
    color: #6c5ce7;
    /* Fallback */
    /* Icon Gradient */
    background: linear-gradient(45deg, #6c5ce7, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Menu */
.sidebar-menu {
    padding: 20px 15px;
    list-style: none;
    margin-top: 10px;
}

.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #a0aec0;
    /* Softer gray */
    letter-spacing: 1.2px;
    margin: 25px 0 10px 15px;
    font-weight: 700;
    display: block;
}

.menu-label:first-child {
    margin-top: 0;
}

.menu-item {
    margin-bottom: 8px;
    /* More spacing */
}

/* Links */
.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    /* Larger click area */
    border-radius: 8px;
    /* Reverted to 8px for badge alignment */
    color: #4a5568;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    border-right: 4px solid transparent;
    /* Prepare for Badge */
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.menu-link i {
    font-size: 22px;
    margin-right: 16px;
    width: 24px;
    text-align: center;
    color: #a0aec0;
    /* Default muted icon */
    transition: all 0.3s;
}

/* Hover State */
.menu-link:hover {
    background-color: #f7fafc;
    color: #2d3748;
    transform: translateX(4px);
    /* Subtle shift */
}

.menu-link:hover i {
    color: #6c5ce7;
    /* Brand color on hover */
}

/* Active State (Classic Pro with Badge) */
.menu-link.active {
    background-color: #eaddff;
    /* Stronger Light Purple */
    color: #6c5ce7 !important;
    font-weight: 700;
    border-right-color: #6c5ce7;
    /* The Badge is Back */
}

.menu-link.active i {
    color: #6c5ce7 !important;
    /* Brand Color Icon */
}

/* Logout Special */
.menu-link.text-danger:hover {
    background-color: #fff5f5;
    color: #e53e3e;
}

.menu-link.text-danger:hover i {
    color: #e53e3e;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    /* Space for Sidebar */
    padding: 0;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f4f6f9;
}

/* --- TOP HEADER --- */
.top-header {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #dfe6e9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    margin-left: auto;
}

.content-body {
    padding: 30px;
    flex: 1;
}

/* --- MOBILE SIDEBAR & OVERLAY --- */

/* 1. Overlay (Background Dimmer) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent Black */
    backdrop-filter: blur(3px);
    /* Blur Effect */
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* 2. Responsive Logic (Tablets & Mobile) */
@media (max-width: 900px) {

    /* Sidebar By Default Hidden (Off-Canvas) */
    .sidebar {
        transform: translateX(-100%);
        /* Screen se bahar */
        width: 270px;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Jab Active class lage to Slide In karo */
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    /* Content ko full width karo */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Padding Fixes */
    .top-header {
        padding: 0 15px;
    }

    .content-body {
        padding: 15px;
        overflow-x: hidden;
    }

    /* Tables Scrollable Fix */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Sidebar Red Dot Notification --- */
.red-dot {
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    /* Red Color */
    border-radius: 50%;
    margin-left: auto;
    /* Right side par push karega */
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    display: none;
    /* Default hidden */
}

/* --- GLOBAL BACK BUTTON --- */
.btn-back {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-back:hover {
    background: #f1f5f9;
    color: #334155 !important;
}

.btn-back i {
    font-size: 16px;
}