/* assets/css/dashboard_layout.css (Upgraded Professional Design) */

/* --- Base Styles & Enhanced Variables --- */
:root {
    --primary-color: #4f46e5;
    --primary-color-dark: #4338ca;
    --primary-color-light: #eef2ff;
    --text-color-dark: #111827;
    --text-color-normal: #374151;
    --text-color-light: #6b7280;
    --bg-color: #f9fafb;
    --panel-bg: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    --font-family: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 0.5rem;
    --border-radius-md: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color-normal);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-color-dark);
    transition: var(--transition-fast);
}
.sidebar-logo:hover {
    transform: scale(1.03);
}

.logo-icon {
    height: 36px;
    transition: transform 0.5s ease;
}
.sidebar-logo:hover .logo-icon {
    transform: rotate(15deg);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    color: var(--text-color-light);
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
}

.menu-link i {
    font-size: 1.25rem;
    z-index: 2;
}
.menu-link span {
    z-index: 2;
}

.menu-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.menu-link.active {
    background: linear-gradient(90deg, var(--primary-color-light), #fff);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-color);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}


.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.logout-link:hover {
    color: var(--danger-color);
    background-color: #fef2f2;
}

/* --- Main Content & Header --- */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(5px);
    -webkit-backdrop-filter: saturate(180%) blur(5px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
    transition: box-shadow 0.3s ease;
}
.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-color-light);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color-light);
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.header-icon-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.notification-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- Dropdowns (Notifications & Profile) --- */
.notification-wrapper, .profile-wrapper {
    position: relative;
}

.notification-dropdown, .profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 340px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1100;
}

.notification-wrapper.open .notification-dropdown,
.profile-wrapper.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color-normal);
    transition: var(--transition-fast);
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: var(--bg-color); }

.notification-item.unread { font-weight: 600; }
.notification-item.unread .notification-content p { color: var(--text-color-dark); }


.notification-icon-wrapper { color: var(--primary-color); font-size: 1.2rem; }
.notification-content p { font-size: 0.9rem; margin-bottom: 0.25rem; }
.notification-content small { font-size: 0.75rem; color: var(--text-color-light); }
.notification-item.empty { justify-content: center; color: var(--text-color-light); }
.dropdown-footer { padding: 0.75rem; text-align: center; border-top: 1px solid var(--border-color); }
.dropdown-footer a { color: var(--primary-color); text-decoration: none; font-weight: 500; font-size: 0.9rem; }

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
}
.profile-trigger:hover { background-color: var(--bg-color); }

.profile-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.profile-info { text-align: left; display: block; }
.profile-name { font-weight: 600; font-size: 0.9rem; color: var(--text-color-dark); }
.profile-role { font-size: 0.8rem; color: var(--text-color-light); }
.profile-trigger i { color: var(--text-color-light); transition: var(--transition-fast); }
.profile-wrapper.open .profile-trigger i { transform: rotate(180deg); }

.profile-dropdown { width: 220px; padding: 0.5rem; }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: var(--border-radius-sm); text-decoration: none; color: var(--text-color-normal); font-size: 0.9rem; transition: var(--transition-fast); }
.dropdown-item:hover { background-color: var(--bg-color); color: var(--primary-color); }
.dropdown-item.logout:hover { background-color: #fef2f2; color: var(--danger-color); }
.dropdown-divider { height: 1px; background-color: var(--border-color); margin: 0.5rem 0; }

/* --- Content Area --- */
.content-area {
    padding: 2rem;
    flex-grow: 1;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: block; }
    .profile-info, .profile-trigger i { display: none; }
}

@media (max-width: 576px) {
    .header { padding: 0 1rem; }
    .header-title { font-size: 1.2rem; }
    .content-area { padding: 1.5rem 1rem; }
}
