/* Admin Panel Styles */

/* Admin Body */
.admin-body,
.admin-login-body {
    background: linear-gradient(135deg, 
        var(--white) 0%, 
        var(--ultra-light-blue) 25%, 
        var(--light-blue) 50%, 
        var(--ultra-light-blue) 75%, 
        var(--soft-white) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-body::before,
.admin-login-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(237, 233, 254, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Navigation */
.admin-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 32px rgba(139, 92, 246, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', 'Inter', serif;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-icon {
    font-size: 1.5rem;
    color: #8b5cf6;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
    color: var(--white);
    border-color: #dc2626;
    text-decoration: none;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 16px 64px rgba(139, 92, 246, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.login-icon i {
    width: 2rem;
    height: 2rem;
    color: #8b5cf6;
}

.login-title {
    font-family: 'Poppins', 'Inter', serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
}

.input-icon i {
    width: 1rem;
    height: 1rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
    font-family: inherit;
}

textarea.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.btn-login {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: var(--white);
    border: none;
    border-radius: 0.75rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-login:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
    opacity: 0.9;
}

.btn-icon {
    width: 1rem;
    height: 1rem;
}

.error-alert {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.success-alert {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #8b5cf6;
    text-decoration: none;
}

.login-info {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 300px;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.info-card small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 32px rgba(139, 92, 246, 0.1);
}

.stat-card:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.2);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
}

.stat-icon-green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon-orange {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.stat-icon i {
    width: 1.5rem;
    height: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-family: 'JetBrains Mono', 'Poppins', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.btn-create {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: var(--white);
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-create:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
    color: var(--white);
    opacity: 0.9;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select,
.search-input {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 150px;
}

.filter-select:focus,
.search-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

/* Table Container */
.table-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    background: rgba(139, 92, 246, 0.05);
}

.table-title {
    font-family: 'Poppins', 'Inter', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.sort-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    min-width: 200px;
    color: var(--text-primary);
}

.sort-select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #8b5cf6;
    color: var(--white);
    border-color: #8b5cf6;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    margin: 0;
    font-size: 0.85rem;
}

.admin-table th {
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem 0.75rem;
    border: none;
    white-space: nowrap;
    position: relative;
}

.admin-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding-right: 2rem;
}

.admin-table th.sortable:hover {
    background: rgba(139, 92, 246, 0.1);
}

.admin-table th.sortable.sorted {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    color: var(--text-muted);
}

.admin-table th.sortable:hover .sort-indicator,
.admin-table th.sortable.sorted .sort-indicator {
    opacity: 1;
    color: #8b5cf6;
}

.admin-table td {
    padding: 1rem 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.admin-table .description-content {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.admin-table .description-content:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 20px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-upcoming {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-past {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.status-today {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-sm {
    padding: 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-edit {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.btn-edit:hover {
    background: #22c55e;
    color: var(--white);
    border-color: #22c55e;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: #dc2626;
    color: var(--white);
    border-color: #dc2626;
}

.class-links {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.link-badge {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-badge:hover {
    background: #8b5cf6;
    color: var(--white);
    text-decoration: none;
}

.table-loading {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.table-loading .spinner-border {
    color: #8b5cf6;
    margin-bottom: 1rem;
}

.no-classes {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.no-classes-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-classes h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Modal Customizations */
.custom-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    box-shadow: 0 16px 64px rgba(139, 92, 246, 0.2);
}

.custom-modal .modal-header {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    padding: 1.5rem;
}

.custom-modal .modal-title {
    font-family: 'Poppins', 'Inter', serif;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-modal .modal-body {
    padding: 1.5rem;
}

.custom-modal .modal-footer {
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    padding: 1.5rem;
}

/* Fix close button */
.btn-close {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 1;
}

.btn-close::before {
    content: "×";
    font-size: 1.5rem;
    line-height: 1;
    color: #8b5cf6;
    font-weight: 600;
}

.btn-close:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.btn-close:hover::before {
    color: var(--white);
}

.link-input-group {
    margin-bottom: 0.75rem;
}

.link-input-group .row {
    align-items: center;
}

.link-title,
.link-url {
    font-size: 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
}

.link-title:focus,
.link-url:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.remove-link {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.375rem;
    padding: 0.375rem;
    transition: all 0.2s ease;
}

.remove-link:hover {
    background: #dc2626;
    color: var(--white);
    border-color: #dc2626;
}

.remove-link i {
    width: 1rem;
    height: 1rem;
}

.delete-confirmation {
    text-align: center;
    padding: 1rem;
}

.delete-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.delete-icon i {
    width: 2rem;
    height: 2rem;
    color: #dc2626;
}

.delete-confirmation h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.delete-confirmation p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    color: var(--white);
    opacity: 0.9;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--text-secondary);
    color: var(--white);
    border-color: var(--text-secondary);
}

/* Color preview */
.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 0.375rem;
    border: 2px solid rgba(139, 92, 246, 0.2);
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

/* Form helper text */
.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-text.text-muted {
    color: var(--text-muted) !important;
}

/* Description styling */
.description-content {
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.description-content br {
    line-height: 1.8;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .action-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-controls {
        justify-content: center;
    }
}

@media (max-width: 991.98px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .user-name {
        display: none;
    }
    
    .admin-container {
        padding: 1.5rem 1rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .filter-controls {
        flex-wrap: wrap;
    }
    
    .filter-select,
    .search-input {
        min-width: 120px;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .action-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-actions {
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .sort-select {
        min-width: auto;
        flex: 1;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Better mobile modal handling */
    .modal-dialog {
        margin: 0.5rem;
        max-width: none;
    }
    
    .custom-modal .modal-header,
    .custom-modal .modal-body,
    .custom-modal .modal-footer {
        padding: 1rem;
    }
    
    .link-input-group .row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .link-input-group .col-md-4,
    .link-input-group .col-md-6,
    .link-input-group .col-md-2 {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .login-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .login-icon i {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .admin-container {
        padding: 1rem 0.5rem;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-select,
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sort-select {
        width: 100%;
        min-width: auto;
    }
    
    .btn-outline {
        justify-content: center;
    }
    
    .admin-table {
        font-size: 0.75rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Very small screen modal adjustments */
    .modal-dialog {
        margin: 0.25rem;
    }
    
    .custom-modal .modal-header,
    .custom-modal .modal-body,
    .custom-modal .modal-footer {
        padding: 0.75rem;
    }
    
    .custom-modal .modal-title {
        font-size: 1rem;
    }
    
    .form-group {
        gap: 0.375rem;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem 0.5rem 2.5rem;
        font-size: 0.8rem;
    }
    
    .input-icon {
        left: 0.75rem;
    }
    
    .btn-create,
    .btn-login {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
}

/* Additional mobile table improvements */
@media (max-width: 480px) {
    .table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 600px;
        font-size: 0.7rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.375rem 0.25rem;
        white-space: nowrap;
    }
    
    .admin-table th.sortable {
        padding-right: 1.5rem;
    }
    
    .sort-indicator {
        font-size: 10px;
        right: 0.25rem;
    }
    
    .class-links {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .link-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.375rem;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.admin-container {
    animation: fadeIn 0.5s ease-in-out;
}

.stat-card {
    animation: fadeIn 0.6s ease-in-out;
}

.table-container {
    animation: fadeIn 0.7s ease-in-out;
}

/* Custom scrollbar for tables */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.05);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Pagination Styles */
#pagination-container {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.pagination {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
}

.pagination .page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    user-select: none;
}

.pagination .page-item .page-link:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

.pagination .page-item.active .page-link {
    z-index: 3;
    color: var(--white);
    background: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: rgba(230, 230, 230, 0.5);
    border-color: rgba(139, 92, 246, 0.05);
}