/* Admin Form Styles */

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
}

.form-label.fw-bold {
    color: #212529;
    margin-bottom: 0.5rem;
}

.form-control-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-control-lg:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-check.form-switch {
    padding-left: 2.5em;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-label.fw-bold {
    color: #212529;
}

/* Quill Editor Styles */
.ql-container {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.ql-editor {
    min-height: 350px;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5em 0;
    display: block !important;
    object-fit: contain;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Image alignment styles */
.ql-editor img[style*="float: left"] {
    float: left !important;
    margin: 0.5em 1em 0.5em 0 !important;
}

.ql-editor img[style*="float: right"] {
    float: right !important;
    margin: 0.5em 0 0.5em 1em !important;
}

.ql-editor img[style*="margin: 0.5em auto"] {
    display: block !important;
    margin: 0.5em auto !important;
    float: none !important;
}

/* Image Gallery Wrapper */
.ql-editor .image-gallery-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1em 0;
    width: 100%;
    clear: both;
}

.ql-editor .image-gallery-wrapper img {
    flex: 0 0 auto;
    margin: 0 !important;
    float: none !important;
}

.ql-editor .image-gallery-wrapper:has(img:nth-child(2):last-child) img {
    flex: 0 0 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
}

.ql-editor .image-gallery-wrapper:has(img:nth-child(3):last-child) img,
.ql-editor .image-gallery-wrapper:has(img:nth-child(4):last-child) img,
.ql-editor .image-gallery-wrapper:has(img:nth-child(5):last-child) img,
.ql-editor .image-gallery-wrapper:has(img:nth-child(6):last-child) img {
    flex: 0 0 calc(33.333% - 0.67rem);
    max-width: calc(33.333% - 0.67rem);
}

.ql-editor .image-gallery-wrapper:has(img:nth-child(7):last-child) img,
.ql-editor .image-gallery-wrapper:has(img:nth-child(8):last-child) img,
.ql-editor .image-gallery-wrapper:has(img:nth-child(9):last-child) img {
    flex: 0 0 calc(25% - 0.75rem);
    max-width: calc(25% - 0.75rem);
}

/* Side by side images */
.ql-editor p:has(img) {
    overflow: hidden;
}

.ql-editor p:has(img) + p:has(img) {
    margin-top: 0;
}

/* Reduce spacing for headings that only contain images in editor */
.ql-editor h1:has(img):not(:has(*:not(img))),
.ql-editor h2:has(img):not(:has(*:not(img))),
.ql-editor h3:has(img):not(:has(*:not(img))),
.ql-editor h4:has(img):not(:has(*:not(img))),
.ql-editor h5:has(img):not(:has(*:not(img))),
.ql-editor h6:has(img):not(:has(*:not(img))) {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Remove margin for empty headings in editor */
.ql-editor h1:empty,
.ql-editor h2:empty,
.ql-editor h3:empty,
.ql-editor h4:empty,
.ql-editor h5:empty,
.ql-editor h6:empty {
    margin: 0;
    padding: 0;
    height: 0;
    line-height: 0;
    overflow: hidden;
}

/* Remove margin for headings with only <br> in editor */
.ql-editor h1:has(br:only-child),
.ql-editor h2:has(br:only-child),
.ql-editor h3:has(br:only-child),
.ql-editor h4:has(br:only-child),
.ql-editor h5:has(br:only-child),
.ql-editor h6:has(br:only-child) {
    margin: 0;
    padding: 0;
    height: 0;
    line-height: 0;
    overflow: hidden;
}

/* Ensure images in Quill editor are visible */
.ql-editor .ql-image {
    display: inline-block;
    max-width: 100%;
}

.ql-editor img[src] {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* Fix for Quill image display */
.ql-editor .ql-image img,
.ql-editor img.ql-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100%;
    height: auto;
}

/* Image resize functionality */
.ql-editor {
    position: relative;
}

.ql-editor img {
    cursor: pointer;
    transition: all 0.3s ease;
}

.ql-editor img:hover {
    box-shadow: 0 0 0 2px #2563eb;
}

.ql-editor img.selected {
    box-shadow: 0 0 0 3px #2563eb;
    outline: none;
}

/* Image resize handles */
.image-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2563eb;
    border: 2px solid white;
    border-radius: 50%;
    cursor: se-resize;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.image-resize-handle:hover {
    background: #1e40af;
    transform: scale(1.3);
}

.image-resize-handle.nw { cursor: nw-resize; }
.image-resize-handle.ne { cursor: ne-resize; }
.image-resize-handle.sw { cursor: sw-resize; }
.image-resize-handle.se { cursor: se-resize; }

/* Image controls */
.image-controls {
    position: absolute;
    background: #333;
    border-radius: 4px;
    padding: 4px 6px;
    display: flex;
    gap: 4px;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.image-controls button {
    background: none;
    border: none;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s;
    margin: 0 2px;
}

.image-controls button:hover {
    background: #555;
    transform: scale(1.1);
}

.image-controls button.active {
    background: #007bff;
    color: white;
}

.image-controls button.active:hover {
    background: #0056b3;
}

.ql-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #dee2e6;
}

.ql-container {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Button Styles */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

/* Image Preview */
.img-fluid.rounded {
    border: 2px solid #dee2e6;
    padding: 4px;
}

/* Admin Dashboard Styles - Elegant & Professional */
.stat-card-elegant {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.stat-card-elegant:nth-child(1) { animation-delay: 0.1s; }
.stat-card-elegant:nth-child(2) { animation-delay: 0.2s; }
.stat-card-elegant:nth-child(3) { animation-delay: 0.3s; }

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

.stat-card-elegant::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card-elegant:hover::before {
    left: 100%;
}

.stat-card-elegant:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3b82f6;
    transform: translateY(-5px) scale(1.02);
}

.stat-icon-elegant {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

.stat-card-elegant:hover .stat-icon-elegant {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.stat-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
}

.stat-icon-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

.stat-icon-green {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
}

.stat-icon-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5) !important;
}

.stat-icon-teal {
    background: linear-gradient(135deg, #0f766e, #115e59) !important;
    box-shadow: 0 4px 15px rgba(15, 118, 110, 0.5) !important;
}

.stat-icon-red {
    background: linear-gradient(135deg, #b91c1c, #991b1b) !important;
    box-shadow: 0 4px 15px rgba(185, 28, 28, 0.5) !important;
}

.stat-icon-indigo {
    background: linear-gradient(135deg, #4338ca, #3730a3) !important;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.5) !important;
}

.stat-icon-cyan {
    background: linear-gradient(135deg, #0e7490, #155e75) !important;
    box-shadow: 0 4px 15px rgba(14, 116, 144, 0.5) !important;
}

.stat-info-elegant {
    flex-grow: 1;
}

.stat-label-elegant {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number-elegant {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card-elegant:hover .stat-number-elegant {
    transform: scale(1.05);
}

.stat-desc-elegant {
    color: #6c757d;
    font-size: 0.8125rem;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Admin Menu - Elegant Design */
.menu-item-elegant {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    transition: all 0.2s ease;
    height: 100%;
}

.menu-item-elegant:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-decoration: none;
    color: #212529;
}

.menu-icon-elegant {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.menu-icon-blue {
    background: #1976D2;
}

.menu-icon-green {
    background: #4CAF50;
}

.menu-icon-purple {
    background: #9C27B0;
}

.menu-icon-gray {
    background: #757575;
}

.menu-text-elegant {
    flex-grow: 1;
}

.menu-item-elegant .fa-chevron-right {
    opacity: 0.4;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.menu-item-elegant:hover .fa-chevron-right {
    opacity: 0.7;
    transform: translateX(2px);
}

/* Admin Sidebar Layout */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #1e3a8a 0%, #3b82f6 100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow-y: auto;
    animation: slideInLeft 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.admin-sidebar-user-info {
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.admin-sidebar-user-info small {
    display: block;
    text-align: center;
    opacity: 0.9;
}

.admin-sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: fadeInDown 0.5s ease-out;
}

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

.admin-sidebar-brand:hover {
    color: #fbbf24;
    text-decoration: none;
    transform: scale(1.05);
}

.admin-sidebar-brand i {
    color: #fbbf24;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.admin-sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.admin-sidebar-footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, #1e3a8a 0%, #3b82f6 100%);
    z-index: 10;
}

.admin-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-menu-list li {
    margin: 0;
    animation: fadeInLeft 0.5s ease-out;
    animation-fill-mode: both;
}

.admin-menu-dropdown-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-menu-dropdown-toggle span {
    flex: 1;
}

.admin-menu-chevron {
    margin-left: auto;
    margin-right: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.9;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
    flex-shrink: 0;
}

.admin-menu-dropdown-toggle:hover .admin-menu-chevron {
    color: #fbbf24;
    opacity: 1;
    transform: scale(1.3);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.5));
}

.admin-menu-dropdown-toggle[aria-expanded="true"] .admin-menu-chevron {
    transform: rotate(180deg) scale(1.2);
    color: #fbbf24;
    opacity: 1;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.7));
    animation: chevronPulse 2s ease-in-out infinite;
}

.admin-menu-dropdown-toggle.active .admin-menu-chevron {
    color: #fbbf24;
    opacity: 1;
    animation: bounceChevron 0.6s ease, chevronPulse 2s ease-in-out infinite 0.6s;
}

@keyframes bounceChevron {
    0%, 100% {
        transform: rotate(180deg) scale(1.2);
    }
    50% {
        transform: rotate(180deg) scale(1.5);
    }
}

@keyframes chevronPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
        filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.7));
    }
    50% {
        text-shadow: 0 0 15px rgba(251, 191, 36, 1);
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 1));
    }
}

.admin-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid rgba(251, 191, 36, 0.3);
    margin-left: 1rem;
    padding-left: 0.5rem;
}

.admin-submenu li {
    margin: 0;
}

.admin-submenu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.admin-submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding-left: 1.25rem;
}

.admin-submenu-link.active {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-left: 3px solid #fbbf24;
    font-weight: 600;
}

.admin-submenu-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 0.85rem;
}

.admin-menu-list li:nth-child(1) { animation-delay: 0.1s; }
.admin-menu-list li:nth-child(2) { animation-delay: 0.2s; }
.admin-menu-list li:nth-child(3) { animation-delay: 0.3s; }
.admin-menu-list li:nth-child(4) { animation-delay: 0.4s; }
.admin-menu-list li:nth-child(5) { animation-delay: 0.5s; }
.admin-menu-list li:nth-child(6) { animation-delay: 0.6s; }

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

.admin-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.admin-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: width 0.3s ease;
    z-index: 0;
}

.admin-menu-link:hover::before {
    width: 100%;
}

.admin-menu-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.admin-menu-link span {
    position: relative;
    z-index: 1;
}

.admin-menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-left-color: #fbbf24;
    transform: translateX(5px);
}

.admin-menu-link:hover i {
    color: #fbbf24;
    transform: scale(1.2) rotate(5deg);
}

.admin-menu-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: #fbbf24;
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(251,191,36,0.2);
}

.admin-menu-link.active i {
    color: #fbbf24;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.admin-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 0.75rem 1.5rem;
    animation: expandWidth 0.5s ease-out;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: calc(100% - 3rem);
    }
}

/* Main Content Area */
.admin-main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.admin-content-wrapper {
    padding: 2rem;
    animation: slideInRight 0.5s ease-out;
}

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

.school-header-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 0.75rem 1.5rem;
    margin: -2rem 0 1rem -2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 3px solid rgba(255,255,255,0.2);
    width: calc(100vw - 260px);
    position: relative;
    left: 0;
    box-sizing: border-box;
}

.school-header-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.school-header-profile {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.school-header-profile:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
}

.admin-page-header {
    margin-bottom: 2rem;
}

.admin-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: fadeInDown 0.5s ease-out;
}

.admin-page-subtitle {
    color: #6c757d;
    margin: 0;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* Mobile Toggle Button */
.admin-sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.admin-sidebar-toggle:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.admin-sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar Close Button */
.admin-sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-sidebar-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Sidebar Overlay */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.admin-sidebar-overlay.show {
    display: block;
    opacity: 1;
}


/* Responsive */

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar-toggle {
        display: flex;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-sidebar-close {
        display: flex;
    }
    
    .admin-main-content {
        margin-left: 0;
    }
    
    .admin-content-wrapper {
        padding: 1rem;
        padding-top: 4rem; /* Space for toggle button */
    }
    
    .admin-page-header {
        margin-top: 1rem;
    }
}
@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .stat-card-admin {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon-admin {
        margin: 0 auto;
    }
    
    .admin-menu-item {
        flex-direction: column;
        text-align: center;
    }
    
    .menu-arrow {
        display: none;
    }
}

/* Modern Chat Styles */
.chat-messages-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: #e5ddd5;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
    margin-bottom: 0;
    border-radius: 0;
}

.chat-message {
    display: flex;
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.2s ease-out;
    align-items: flex-end;
}

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

.chat-message.sent {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.chat-message.received {
    justify-content: flex-start;
}

.chat-message-bubble {
    max-width: 55%;
    padding: 0.5rem 0.75rem 0.375rem 0.75rem;
    border-radius: 7.5px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-message.sent .chat-message-bubble {
    background: #dcf8c6;
    color: #303030;
    border-bottom-right-radius: 0;
    margin-left: auto;
}

.chat-message.received .chat-message-bubble {
    background: #ffffff;
    color: #303030;
    border-bottom-left-radius: 0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.13);
}

.chat-message-sender {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    display: block;
    color: #075e54;
}

.chat-message.sent .chat-message-sender {
    display: none;
}

.chat-message.received .chat-message-sender {
    color: #075e54;
}

.chat-message-text {
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.125rem;
    color: #303030;
    word-break: break-word;
}

.chat-message-time {
    font-size: 0.6875rem;
    margin-top: 0.125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(0,0,0,0.45);
    float: right;
    margin-left: 0.5rem;
    margin-top: 0.125rem;
}

.chat-message.sent .chat-message-time {
    color: rgba(0,0,0,0.45);
}

.chat-message.received .chat-message-time {
    color: rgba(0,0,0,0.45);
}

/* Modern Chat Input Area */
.chat-input-section {
    background: #f0f0f0;
    padding: 0.75rem;
    border-radius: 0;
    border-top: 1px solid #e0e0e0;
}

.chat-input-section h6 {
    display: none;
}

.chat-input-section .form-label {
    display: none;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: white;
    border-radius: 21px;
    padding: 0.375rem 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-input-section textarea {
    border: none;
    border-radius: 0;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    resize: none;
    flex: 1;
    min-height: 24px;
    max-height: 120px;
    background: transparent;
    outline: none;
    line-height: 1.4;
}

.chat-input-section textarea::placeholder {
    color: #999;
}

.chat-send-button {
    background: #25d366;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(37,211,102,0.3);
}

.chat-send-button:hover {
    background: #20ba5a;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(37,211,102,0.4);
}

.chat-send-button:active {
    transform: scale(0.95);
}

.chat-send-button i {
    font-size: 1.125rem;
}

/* Scrollbar Styling for Chat Container */
.chat-messages-container::-webkit-scrollbar {
    width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty Chat State */
.chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.chat-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modern Chat Modal Header */
.chat-modal-header {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.chat-modal-header .modal-title {
    font-weight: 500;
    font-size: 1rem;
}

.chat-modal-header .btn-close-white {
    filter: brightness(0) invert(1);
}

/* Modal Body for Chat */
.modal-body:has(.chat-messages-container) {
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.modal-body:has(.chat-messages-container) .chat-messages-container {
    flex: 1;
    min-height: 300px;
}

/* Auto-resize textarea */
.chat-input-section textarea {
    overflow-y: auto !important;
}

.chat-input-section textarea:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-message-bubble {
        max-width: 75%;
    }
    
    .chat-messages-container {
        padding: 0.75rem;
        max-height: 400px;
    }
    
    .chat-input-wrapper {
        padding: 0.25rem 0.375rem;
    }
    
    .chat-send-button {
        width: 36px;
        height: 36px;
    }
}

