.bg-navbar,
[class*=sidebar-dark-] {
    background-color: #1e293b;
}

.sidebar {
    padding-left: 0;
    padding-right: 0;
}

/* Prevent sidebar text wrapping on all devices */
.sidebar .nav-link {
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.sidebar .nav-link p,
.sidebar .nav-link .bangla,
.nav-sidebar .nav-item>.nav-link p {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Ensure sidebar has enough width on mobile */
@media (max-width: 768px) {
    .main-sidebar {
        min-width: 280px !important;
    }

    .sidebar .nav-link {
        width: 100% !important;
    }
}

.sidebar-mini .main-sidebar .nav-link,
.sidebar-mini-md .main-sidebar .nav-link,
.sidebar-mini-xs .main-sidebar .nav-link {
    width: 100%;
}

.nav-sidebar .nav-item>.nav-link {
    margin-bottom: 0;
}

.nav-pills .nav-link {
    border-radius: 0;
}

.dashboard-link {
    width: 100% !important;
    background-color: #0891b2 !important;
}

.nav-link-p {
    margin-left: 26px !important;
}

.nav-link-p-nasted {
    margin-left: 42px !important;
}

.content-header {
    background: #fff;
    margin-bottom: 25px;
}

.content-header .page-title-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.page-title-heading,
.page-title-subheading {
    margin: 0;
    padding: 0;
}

.content-header .page-title-heading {
    font-size: 1.25rem;
    font-weight: 400;
    display: flex;
    align-content: center;
    align-items: center;
}

.content-header .page-title-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    align-content: center;
    text-align: center;
    padding: 0.83333rem;
    margin: 0 30px 0 0;
    background: #fff;
    box-shadow: 0 0.46875rem 2.1875rem rgb(4 9 20 / 3%), 0 0.9375rem 1.40625rem rgb(4 9 20 / 3%), 0 0.25rem 0.53125rem rgb(4 9 20 / 5%), 0 0.125rem 0.1875rem rgb(4 9 20 / 3%);
    border-radius: 0.25rem;
    width: 60px;
    height: 60px;
}

.content-header .page-title-subheading {
    padding: 3px 0 0;
    font-size: .88rem;
    opacity: .6;
}

.content-header .page-title-actions {
    margin-left: auto;
}

.navbar-expand .navbar-nav .nav-link {
    color: #ffffff !important;
}

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


@media (max-width: 991.98px) {
    .page-title-icon {
        display: none;
    }

    .content-header {
        text-align: center;
    }

    .content-header .page-title-heading,
    .content-header .page-title-wrapper {
        margin: 0 auto;
        display: block;
    }

    .content-header .page-title-actions {
        margin: 15px auto 0;
    }
}

/* Global Fix for DataTables Text Wrapping */
.table.dataTable td,
.table.dataTable th {
    white-space: nowrap !important;
}

.table.dataTable .btn {
    white-space: nowrap !important;
}

/* ========================================
   Admin Floating Button (WhatsApp Style)
   ======================================== */

.admin-floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    z-index: 9999;
}

.admin-floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5), 0 0 0 4px rgba(40, 167, 69, 0.1);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Pulse animation for attention - Unique for WhatsApp button */
.admin-floating-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    opacity: 0.5;
    animation: whatsappPulse 2s infinite;
    z-index: 0;
}

/* Unique pulse animation for WhatsApp button */
@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.admin-floating-btn i {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.admin-floating-btn:hover {
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6), 0 0 0 6px rgba(40, 167, 69, 0.15);
}

.admin-floating-btn:hover i {
    transform: rotate(90deg);
}

.admin-floating-btn:active {
    transform: scale(0.95);
}

.admin-floating-btn:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4), 0 0 0 3px rgba(40, 167, 69, 0.2);
}

/* Admin main button margin */
button.admin-floating-btn.admin-main-btn {
    margin-bottom: 7px;
    margin-left: 0;
}

/* Tablet and below - Responsive Design */
@media (max-width: 1024px) {
    .admin-floating-container {
        bottom: 30px !important;
        right: 20px !important;
        left: auto !important;
    }
    
    .admin-floating-btn {
        width: 58px !important;
        height: 58px !important;
        font-size: 22px !important;
        min-width: 50px !important;
        min-height: 50px !important;
    }
}

/* Mobile responsive for admin floating button */
@media (max-width: 768px) {
    .admin-floating-container {
        bottom: 90px !important;
        right: 20px !important;
        left: auto !important;
    }
    
    button.admin-floating-btn.admin-main-btn {
        margin-left: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .admin-floating-btn {
        width: 56px !important;
        height: 56px !important;
        font-size: 22px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 60px !important;
        max-height: 60px !important;
    }
    
    .admin-floating-sub-buttons {
        bottom: 70px !important;
        right: 0 !important;
        left: auto !important;
    }
    
    .admin-sub-btn {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

@media (max-width: 480px) {
    .admin-floating-container {
        bottom: 90px !important;
        right: 16px !important;
        left: auto !important;
    }
    
    .admin-floating-btn {
        width: 52px !important;
        height: 52px !important;
        font-size: 20px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 56px !important;
        max-height: 56px !important;
    }
    
    .admin-sub-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 18px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
}

/* Extra small devices and zoom handling */
@media (max-width: 360px) {
    .admin-floating-container {
        bottom: 85px !important;
        right: 12px !important;
    }
    
    .admin-floating-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* Zoom handling - ensure button is always visible */
@media (min-width: 320px) and (max-width: 1920px) {
    .admin-floating-container {
        position: fixed !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    .admin-floating-btn {
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .admin-floating-container {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .admin-floating-btn {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Sub-buttons container */
.admin-floating-sub-buttons {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10000;
}

/* Expanded state - show sub-buttons */
.admin-floating-sub-buttons.expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 10000;
}

/* Sub-button styles - Unique design */
.admin-sub-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    text-decoration: none;
}

.admin-sub-btn:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.admin-sub-btn:active {
    transform: scale(1.05) translateY(0);
}

.admin-sub-btn i {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.admin-sub-btn:hover i {
    transform: scale(1.1);
}

/* Main button rotation when expanded */
.admin-main-btn.expanded {
    transform: rotate(45deg);
}

.admin-main-btn.expanded:hover {
    transform: rotate(45deg) scale(1.1);
}

/* Modal Enhancements */
#studentSearchModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#studentSearchModal .modal-header {
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

#studentSearchModal .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.2s ease;
}

#studentSearchModal .form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

#studentSearchModal .btn {
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#studentSearchModal .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

#studentSearchModal .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Mobile Responsiveness - Student Search Modal */
@media (max-width: 768px) {
    #studentSearchModal .modal-dialog {
        margin: 16px;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 991px) {
    .admin-floating-container {
        bottom: 32px;
        right: 32px;
    }
}