/* Header component styles (moved out of css/custom.css) */

/* Typography: header menus + action buttons should use the readable UI font.
   The site uses a display font for headings; header navigation/buttons should
   remain legible and consistent across pages. */
header.main-header .main-menu ul li.nav-item a,
header.main-header .main-menu ul ul li.nav-item a,
header.main-header .header-actions .btn-default,
header.main-header .header-actions button,
header.main-header .header-actions a,
#mobileSidebar .mobile-nav a{
    font-family: var(--default-font);
}

/* Dark/Light toggle (Florin Pop demo adapted) */
.theme-toggle{ display:inline-flex; align-items:center; margin-right:12px; vertical-align:middle; }
.checkbox{ opacity:0; position:absolute; }
.label{
	background-color:#111;
	border-radius:50px;
	cursor:pointer;
	display:flex;
	align-items:center;
	justify-content:space-between;
	padding:5px;
	position:relative;
	height:26px;
	width:50px;
	transform:scale(1.5); /* keeps the original demo appearance */
	border: 1.8px solid rgba(184,134,11,0.44); /* clearer golden outline */
	box-shadow: 0 6px 18px rgba(0,0,0,0.12), 0 0 18px rgba(184,134,11,0.03) inset;
	transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, transform 0.12s ease;
	overflow: hidden; /* ensure the ball can hide icons cleanly */
}
.label .ball{
	background-color:#fff;
	border-radius:50%;
	position:absolute;
	top:2px; left:2px;
	height:22px; width:22px; /* demo ball size */
	transform:translateX(0px);
	transition:transform 0.18s linear, box-shadow 0.12s ease;
	box-shadow: 0 2px 6px rgba(0,0,0,0.12);
	z-index: 2; /* above icons to hide them */
}
.checkbox:checked + .label .ball{ transform:translateX(24px); }
.label i{ font-size:12px; display:inline-block; line-height:1; position:absolute; top:50%; transform:translateY(-50%); z-index:1; }
.label .fa-moon{ color:#f1c40f; left:8px; }
.label .fa-sun{ color:#f39c12; right:8px; }

.label:hover{ border-color: rgba(184,134,11,0.64); box-shadow: 0 10px 30px rgba(184,134,11,0.08); transform:scale(1.52); }
.checkbox:checked + .label{ border-color: rgba(184,134,11,0.72); box-shadow: 0 10px 34px rgba(184,134,11,0.12); }

/* stronger outline in dark theme */
body.dark .label{ border-color: rgba(184,134,11,0.48); }

/* align header button area */
.header-btn{ display:flex; align-items:center; gap:12px; }
/* ensure toggle doesn't shrink on small screens */
.theme-toggle{ flex:0 0 auto; }

/* Smooth fade animations for buttons */
#loginBtn, #admissionBtn, #adminPanelBtn, #userProfile, #webNotificationBadge {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease;
}

/* Enhanced hover effects for buttons */
.btn-default:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.btn-default.btn-highlighted:hover {
    box-shadow: 0 6px 24px rgba(255,255,255,0.2);
}
.theme-toggle .label:hover {
    box-shadow: 0 8px 28px rgba(184,134,11,0.18);
}

/* User Profile Styles */
.user-profile {
    position: relative;
    margin-left: 16px;
}
.profile-dropdown {
    position: relative;
}
.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid rgba(184,134,11,0.38);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.profile-avatar:hover {
    border-color: rgba(184,134,11,0.68);
    box-shadow: 0 4px 12px rgba(184,134,11,0.2);
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}
.profile-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1000;
}
.profile-dropdown:hover .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel header uses .profile-container + .open class (not .profile-dropdown:hover). */
.profile-container.open .profile-menu,
.profile-container:focus-within .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.profile-info {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.profile-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #111;
    margin-bottom: 4px;
}
.profile-role {
    display: block;
    font-size: 12px;
    color: #6b7280;
}
.profile-links {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}
.profile-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}
.profile-links li a:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}
.profile-links li a i {
    width: 16px;
    text-align: center;
}

/* Notification Badge Styles */
.notification-badge {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 999;
}
.badge-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    position: relative;
    box-sizing: border-box;
    border: 1px solid rgba(212, 175, 55, 0.55); /* golden outline */
    outline: 2px solid rgba(212, 175, 55, 0.9);
    outline-offset: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.badge-link:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.badge-link i {
    font-size: 22px;
    animation: bellRing 2s ease-in-out infinite;
}
.badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.badge-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #111;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.notification-badge:hover .badge-tooltip {
    opacity: 1;
    visibility: visible;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* Dark theme adjustments */
body.dark .profile-menu {
    background: #1f2937;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
body.dark .profile-info {
    border-bottom-color: #374151;
}
body.dark .profile-name {
    color: #f3f4f6;
}
body.dark .profile-links li a {
    color: #d1d5db;
}
body.dark .profile-links li a:hover {
    background: #374151;
    color: var(--accent-color);
}

/* Dark theme globals - adjust as needed */
body.dark{
	background:#0f1113 !important;
	color: #d9d9d9;
}
body.dark a{ color: #f5c674; }
body.dark .main-header{ background: linear-gradient(120deg, rgba(10,8,4,0.98) 0%, rgba(22,18,8,0.92) 100%); }
body.dark .btn-default{ background-color: #222; border-color:#333; color:#f1f1f1; }

/* Header Actions Container - Always Visible */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    order: 2;
}

/* Desktop navbar container flex */
.navbar .container {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.navbar .main-menu {
    order: 1;
}

/* ========================================
   MOBILE/TABLET RESPONSIVE - International Standard
   ======================================== */

@media (max-width: 991px) {
    /* Container layout */
    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        position: relative;
    }
    
    /* Logo - left side */
    .navbar .navbar-brand {
        order: 1;
        flex-shrink: 0;
    }
    
    /* Header actions - fills space between logo and toggle */
    .header-actions {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        order: 2;
        flex: 1;
        margin: 0 15px;
    }
    
    /* ===== BUTTONS - Auto width for full text ===== */
    .header-actions .btn-default {
        height: 44px;
        width: auto;
        padding: 0 20px;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .header-actions .btn-default:hover {
        transform: translateY(-2px);
    }

	/* Remove decorative arrow/icon added with ::before for header buttons on mobile */
	.header-actions .btn-default::before{
		display: none !important;
		width: 0 !important;
		height: 0 !important;
		background-image: none !important;
		right: auto !important;
	}
    
    /* ===== DARK MODE TOGGLE - Same height as buttons ===== */
    .header-actions .theme-toggle {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        height: 44px;
    }
    
    .header-actions .theme-toggle .label {
        width: 80px;
        height: 40px;
        transform: none;
        border-radius: 20px;
    }
    
    .header-actions .theme-toggle .label .ball {
        width: 32px;
        height: 32px;
        top: 4px;
        left: 4px;
    }
    
    .header-actions .theme-toggle .checkbox:checked + .label .ball {
        transform: translateX(40px);
    }
    
    .header-actions .theme-toggle .label i {
        font-size: 16px;
    }
    
    /* ===== USER PROFILE - Same height as buttons ===== */
    .header-actions .user-profile {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        height: 44px;
    }
    
    .header-actions .user-profile .profile-dropdown {
        display: flex;
        align-items: center;
        height: 44px;
    }
    
    .header-actions .user-profile .profile-avatar {
        display: flex;
        align-items: center;
    }
    
    .header-actions .user-profile .profile-avatar img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid rgba(184,134,11,0.6);
    }
    
    .header-actions .user-profile .profile-avatar .profile-status {
        width: 12px;
        height: 12px;
        right: -2px;
        bottom: -2px;
        border-width: 2px;
    }
    
    .header-actions .user-profile .profile-dropdown .profile-menu {
        right: 0;
        min-width: 220px;
    }
}

/* ===== TABLET - 768px ===== */
@media (max-width: 768px) {
    .header-actions {
        gap: 8px;
        margin: 0 12px;
    }
    
    .header-actions .btn-default {
        height: 40px;
        padding: 0 16px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .header-actions .theme-toggle {
        height: 40px;
    }
    
    .header-actions .theme-toggle .label {
        width: 72px;
        height: 36px;
        border-radius: 18px;
    }
    
    .header-actions .theme-toggle .label .ball {
        width: 28px;
        height: 28px;
        top: 4px;
        left: 4px;
    }
    
    .header-actions .theme-toggle .checkbox:checked + .label .ball {
        transform: translateX(36px);
    }
    
    .header-actions .theme-toggle .label i {
        font-size: 14px;
    }
    
    .header-actions .user-profile,
    .header-actions .user-profile .profile-dropdown {
        height: 40px;
    }
    
    .header-actions .user-profile .profile-avatar img {
        width: 36px;
        height: 36px;
    }
    
    .header-actions .user-profile .profile-avatar .profile-status {
        width: 10px;
        height: 10px;
    }
}

/* ===== MOBILE - 576px ===== */
@media (max-width: 576px) {
    .header-actions {
        gap: 6px;
        margin: 0 10px;
    }
    
    .header-actions .btn-default {
        height: 38px;
        padding: 0 14px;
        font-size: 12px;
    }
    
    .header-actions .theme-toggle {
        height: 38px;
    }
    
    .header-actions .theme-toggle .label {
        width: 66px;
        height: 34px;
        border-radius: 17px;
    }
    
    .header-actions .theme-toggle .label .ball {
        width: 26px;
        height: 26px;
        top: 4px;
        left: 4px;
    }
    
    .header-actions .theme-toggle .checkbox:checked + .label .ball {
        transform: translateX(32px);
    }
    
    .header-actions .theme-toggle .label i {
        font-size: 13px;
    }
    
    .header-actions .user-profile,
    .header-actions .user-profile .profile-dropdown {
        height: 38px;
    }
    
    .header-actions .user-profile .profile-avatar img {
        width: 34px;
        height: 34px;
    }
    
    .header-actions .user-profile .profile-avatar .profile-status {
        width: 9px;
        height: 9px;
    }
    
    .header-actions .user-profile .profile-dropdown .profile-menu {
        right: -10px;
        min-width: 200px;
    }
}

/* ===== SMALL MOBILE - 480px ===== */
@media (max-width: 480px) {
    .header-actions {
        gap: 5px;
        margin: 0 8px;
    }
    
    .header-actions .btn-default {
        height: 36px;
        padding: 0 12px;
        font-size: 11px;
    }
    
    .header-actions .theme-toggle {
        height: 36px;
    }
    
    .header-actions .theme-toggle .label {
        width: 60px;
        height: 32px;
        border-radius: 16px;
    }
    
    .header-actions .theme-toggle .label .ball {
        width: 24px;
        height: 24px;
        top: 4px;
        left: 4px;
    }
    
    .header-actions .theme-toggle .checkbox:checked + .label .ball {
        transform: translateX(28px);
    }
    
    .header-actions .theme-toggle .label i {
        font-size: 12px;
    }
    
    .header-actions .user-profile,
    .header-actions .user-profile .profile-dropdown {
        height: 36px;
    }
    
    .header-actions .user-profile .profile-avatar img {
        width: 32px;
        height: 32px;
    }
    
    .header-actions .user-profile .profile-avatar .profile-status {
        width: 8px;
        height: 8px;
    }
    
    .header-actions .user-profile .profile-dropdown .profile-menu {
        right: -20px;
        min-width: 180px;
    }
}

/* ===== EXTRA SMALL - 360px ===== */
@media (max-width: 360px) {
    .header-actions {
        gap: 4px;
        margin: 0 5px;
    }
    
    .header-actions .btn-default {
        height: 34px;
        padding: 0 10px;
        font-size: 10px;
    }
    
    .header-actions .theme-toggle {
        height: 34px;
    }
    
    .header-actions .theme-toggle .label {
        width: 54px;
        height: 30px;
        border-radius: 15px;
    }
    
    .header-actions .theme-toggle .label .ball {
        width: 22px;
        height: 22px;
        top: 4px;
        left: 4px;
    }
    
    .header-actions .theme-toggle .checkbox:checked + .label .ball {
        transform: translateX(24px);
    }
    
    .header-actions .theme-toggle .label i {
        font-size: 11px;
    }
    
    .header-actions .user-profile,
    .header-actions .user-profile .profile-dropdown {
        height: 34px;
    }
    
    .header-actions .user-profile .profile-avatar img {
        width: 30px;
        height: 30px;
    }
    
    .header-actions .user-profile .profile-avatar .profile-status {
        width: 7px;
        height: 7px;
    }
}

/* Ensure user profile DP is fully fixed in its circular container and covers the area */
.header-actions .user-profile .profile-avatar{
	overflow: hidden;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid rgba(184,134,11,0.6); /* golden outline */
	box-sizing: border-box;
}
.header-actions .user-profile .profile-avatar img{
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 0; /* image fills parent circle */
}

/* Make parent sizes match previously used image sizes per breakpoint so avatar fits exactly */
@media (max-width: 991px){
	.header-actions .user-profile .profile-avatar{ width:40px; height:40px; }
}
@media (max-width: 768px){
	.header-actions .user-profile .profile-avatar{ width:36px; height:36px; }
}
@media (max-width: 576px){
	.header-actions .user-profile .profile-avatar{ width:34px; height:34px; }
}
@media (max-width: 480px){
	.header-actions .user-profile .profile-avatar{ width:32px; height:32px; }
}
@media (max-width: 360px){
	.header-actions .user-profile .profile-avatar{ width:30px; height:30px; }
}

/* ========================================
   MOBILE SIDEBAR SYSTEM
   ======================================== */

/* Golden Mobile Toggle Button */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8860b, #daa520);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 101;
    margin-left: 8px;
    order: 3;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #daa520, #ffd700);
    box-shadow: 0 6px 18px rgba(184, 134, 11, 0.35);
    transform: translateY(-2px);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 80px; /* Header ke niche 80px ka space */
    left: 0;
    width: 100%;
    height: calc(100% - 80px); /* Header height minus karein */
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 98;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar - Right side below header */
.mobile-sidebar {
    position: fixed;
    top: 80px; /* Header se 80px niche */
    right: -280px; /* Start hidden off-screen on right */
    width: auto; /* Content ke mutabiq width */
    height: auto; /* Content ke mutabiq height */
    min-width: 200px;
     /* Force dark background for the mobile sidebar so it looks the same
         in both light and dark site modes (user requested). */
     background: linear-gradient(120deg, rgba(10,8,4,0.98) 0%, rgba(22,18,8,0.92) 100%);
     color: #e5e7eb; /* default text color on dark background */
     border-radius: 0 0 0 12px;
     box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 99;
    padding: 20px 0;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.mobile-sidebar.open {
    right: 0;
}

/* Mobile Navigation */
.mobile-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav li {
    margin: 0;
    white-space: nowrap;
}

.mobile-nav li a {
    display: block;
    padding: 14px 24px;
    color: #e5e7eb; /* ensure readable on forced dark sidebar */
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav li a:hover,
.mobile-nav li a:focus {
    background: rgba(184, 134, 11, 0.1);
    color: #b8860b;
    border-left-color: #b8860b;
    padding-left: 28px;
}

/* Dark theme adjustments for mobile sidebar */
body.dark .mobile-sidebar {
    background: linear-gradient(120deg, rgba(10,8,4,0.98) 0%, rgba(22,18,8,0.92) 100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

body.dark .mobile-nav li a:hover,
body.dark .mobile-nav li a:focus {
    background: rgba(184, 134, 11, 0.15);
    color: #f5c674;
}

/* Show mobile toggle only on mobile/tablet */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: inline-flex;
    }
    
    .main-menu {
        display: none !important; /* Hide desktop menu on mobile */
    }
}

/* Responsive adjustments for mobile sidebar */
@media (max-width: 768px) {
    .mobile-sidebar {
        top: 70px;
        min-width: 180px;
        padding: 15px 0;
    }
    
    .mobile-overlay {
        top: 70px;
        height: calc(100% - 70px);
    }
    
    .mobile-nav li a {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .mobile-menu-toggle i {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .mobile-sidebar {
        top: 65px;
        min-width: 160px;
        padding: 12px 0;
    }
    
    .mobile-overlay {
        top: 65px;
        height: calc(100% - 65px);
    }
    
    .mobile-nav li a {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mobile-sidebar {
        top: 60px;
        min-width: 140px;
        padding: 10px 0;
    }
    
    .mobile-overlay {
        top: 60px;
        height: calc(100% - 60px);
    }
    
    .mobile-nav li a {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .mobile-menu-toggle {
        width: 34px;
        height: 34px;
    }
    
    .mobile-menu-toggle i {
        font-size: 15px;
    }
}
