/* Local Font Definition: Roboto */
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/roboto-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/roboto-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/roboto-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/roboto-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --sidebar-width: 260px;
    --navbar-height: 70px;
    --transition-speed: 0.3s;
    --font-family-sans-serif: 'Roboto', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-family-sans-serif);
    font-size: 0.9375rem;
    overflow-x: hidden;
}

/* Custom Scrollbar for premium feel */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Main Layout Structure */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bs-border-color);
}

/* Light / Dark Mode Sidebar specific overrides for premium contrast */
[data-bs-theme="light"] #sidebar {
    background-color: #f8f9fa;
}
[data-bs-theme="dark"] #sidebar {
    background-color: #111827; /* Darker than default for premium look */
}

/* Sidebar Header */
.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    color: var(--bs-body-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-link-hover-color);
}

.sidebar-nav .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar-nav .nav-link.active {
    background-color: var(--bs-primary);
    color: #fff !important;
}

/* Main Content Area */
#content-wrapper {
    width: 100%;
    min-height: 100vh;
    padding-left: var(--sidebar-width);
    transition: padding var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
#top-navbar {
    height: var(--navbar-height);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-bs-theme="light"] #top-navbar {
    background-color: rgba(255, 255, 255, 0.85);
}
[data-bs-theme="dark"] #top-navbar {
    background-color: rgba(17, 24, 39, 0.85);
}

/* Page Main Body */
.main-content {
    flex-grow: 1;
    padding: 2rem;
}

/* Footer Styling */
.admin-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--bs-border-color);
}

[data-bs-theme="light"] .admin-footer {
    background-color: #f8f9fa;
}
[data-bs-theme="dark"] .admin-footer {
    background-color: #111827;
}

/* Sidebar Toggle Mechanics (Desktop & Mobile) */
body.sidebar-collapsed #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

body.sidebar-collapsed #content-wrapper {
    padding-left: 0;
}

/* Overlay Backdrop for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Breakpoints */
@media (max-width: 991.98px) {
    /* Hide sidebar by default on mobile/tablet */
    #sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    
    #content-wrapper {
        padding-left: 0 !important;
    }
    
    /* When sidebar is forced open on mobile */
    body.sidebar-mobile-show #sidebar {
        transform: translateX(0);
    }
}

/* Premium Card & Component Styling */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Theme Switcher Button Animations */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-body-color);
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--bs-secondary-bg);
    transform: rotate(15deg);
}

/* Animations helper */
.animated-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

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