/* Modern Sidebar CSS for School Management System */

/* Import Bengali Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@300;400;500;600;700&display=swap');

/* Sidebar Variables */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --hover-color: #e74c3c;
    --text-light: #ecf0f1;
    --text-muted: #bdc3c7;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body Layout */
body {
    font-family: 'Noto Sans Bengali', 'Hind Siliguri', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Main Container */
.sidebar-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(56, 1, 1, 0.658);
    position: relative;
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.sidebar-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    opacity: 1;
    transition: var(--transition);
    line-height: 1.4;
    color: #fff;
}

.sidebar-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 8px 0 0 0;
    opacity: 1;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle {
    opacity: 0;
    transform: scale(0.8);
}

/* Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 2px 15px rgba(52, 152, 219, 0.5);
    z-index: 1001;
    animation: pulse 2s infinite;
}

.sidebar-toggle:hover {
    background: var(--hover-color);
    transform: scale(1.15);
    animation: none;
}

/* Toggle Button Tooltip */
.sidebar-toggle::after {
    content: 'সাইডবার লুকান/দেখান';
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1002;
}

.sidebar-toggle:hover::after {
    opacity: 1;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* User Profile */
.sidebar-user {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.05);
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--accent-color), var(--hover-color));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    opacity: 1;
    transition: var(--transition);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    margin: 5px 0 0 0;
    opacity: 1;
    transition: var(--transition);
}

.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role {
    opacity: 0;
    transform: scale(0.8);
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 0 20px 12px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    opacity: 1;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    border-radius: 0;
    min-height: 48px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(90deg, var(--accent-color), transparent);
    color: white;
    border-left: 4px solid var(--accent-color);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f8f9fa;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-text {
    font-size: 16px;
    font-weight: 600;
    opacity: 1;
    transition: var(--transition);
    line-height: 1.4;
    margin-right: auto;
}

.nav-badge {
    background: var(--hover-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 10px;
    opacity: 1;
    transition: var(--transition);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge {
    opacity: 0;
    width: 0;
    margin: 0;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-icon {
    margin: 0;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
    font-weight: 900 !important;
    margin-left: 8px;
    transition: var(--transition);
    display: inline-block;
}

/* Ensure Font Awesome icons work in sidebar */
.sidebar .fas,
.sidebar .far,
.sidebar .fab,
.sidebar .fa,
.nav-link i,
.nav-dropdown-toggle i,
.nav-dropdown-item i {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
    font-weight: 900 !important;
}

.sidebar .far,
.nav-link i.far,
.nav-dropdown-item i.far {
    font-weight: 400 !important;
}

.sidebar .fab,
.nav-link i.fab,
.nav-dropdown-item i.fab {
    font-family: 'Font Awesome 6 Brands', 'Font Awesome 5 Brands', 'FontAwesome' !important;
}

.nav-dropdown.open .nav-dropdown-toggle::after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    background: rgba(145, 4, 4, 0.349);
}

.nav-dropdown.open .nav-dropdown-menu {
    max-height: 800px;
    overflow-y: auto;
}

.nav-dropdown-item {
    padding: 12px 20px 12px 55px;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    line-height: 1.4;
}

.nav-dropdown-item:hover {
    background: rgba(204, 26, 56, 0.404);
    color: white;
    padding-left: 60px;
}

.sidebar.collapsed .nav-dropdown-menu {
    position: absolute;
    left: var(--sidebar-collapsed-width);
    top: 0;
    width: 200px;
    background: var(--secondary-color);
    border-radius: 0 8px 8px 0;
    box-shadow: var(--shadow);
    z-index: 1002;
}

.sidebar.collapsed .nav-dropdown-item {
    padding: 10px 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    background: #f8f9fa;
    min-height: 100vh;
    position: relative;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Floating Sidebar Toggle Button (visible when sidebar is collapsed) */
.sidebar-toggle-float {
    position: fixed;
    top: 20px;
    left: 80px;
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 2px 15px rgba(52, 152, 219, 0.5);
    z-index: 999;
    animation: pulse 2s infinite;
    opacity: 0;
    visibility: hidden;
}

.sidebar.collapsed + .main-content .sidebar-toggle-float {
    opacity: 1;
    visibility: visible;
}

.sidebar-toggle-float:hover {
    background: var(--hover-color);
    transform: scale(1.15);
    animation: none;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .sidebar-toggle-float {
        left: 60px;
    }
}

/* Content Header */
.content-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e9ecef;
}

.content-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.content-breadcrumb {
    font-size: 14px;
    color: #6c757d;
    margin: 5px 0 0 0;
}

/* Content Body */
.content-body {
    padding: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 8px;
        font-size: 18px;
        cursor: pointer;
        box-shadow: var(--shadow);
        transition: var(--transition);
    }
    
    .mobile-toggle:hover {
        background: var(--accent-color);
        transform: scale(1.05);
    }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, var(--accent-color), var(--hover-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #1a1a1a;
        --secondary-color: #2d2d2d;
        --text-light: #ffffff;
        --text-muted: #a0a0a0;
    }
}

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}