/* Profile Page Styles */

/* Sidebar */
.profile-sidebar {
    background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
    height: 100vh;
    max-height: 100vh;
    width: 280px;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.profile-sidebar::-webkit-scrollbar {
    width: 8px;
}

.profile-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.profile-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.profile-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* User Info in Sidebar */
.sidebar-user-info {
    padding: 100px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.sidebar-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    flex-shrink: 0;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

/* SVG Avatar Container */
.sidebar-avatar-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-avatar-icon {
    width: 36px;
    height: 36px;
    color: #ffffff;
}

.sidebar-username {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
}

.sidebar-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.3;
}

.sidebar-user-text {
    flex: 1;
    min-width: 0;
}

.sidebar-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left-color: #fbbf24;
}

.sidebar-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Menu Section Header */
.sidebar-section-title {
    padding: 16px 24px 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content Area */
.profile-content {
    margin-left: 280px;
    padding: 24px;
    padding-top: 88px; /* Account for fixed header */
    min-height: 100vh;
    background: #f3f4f6;
}

/* Content Cards */
.profile-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.profile-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 12px;
    padding: 20px;
    color: #ffffff;
}

.stat-card.green {
    background: linear-gradient(135deg, #059669, #10b981);
}

.stat-card.purple {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.stat-card.orange {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Progress Bar */
.progress-bar-container {
    background: #e5e7eb;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Table Styles */
.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.profile-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.profile-table tr:hover {
    background: #f9fafb;
}

/* Score Badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.score-badge.excellent {
    background: #dcfce7;
    color: #166534;
}

.score-badge.good {
    background: #dbeafe;
    color: #1e40af;
}

.score-badge.average {
    background: #fef3c7;
    color: #92400e;
}

.score-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Avatar Upload Section */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 24px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-icon {
    width: 50px;
    height: 50px;
    color: #ffffff;
}

.avatar-upload-controls {
    flex: 1;
}

.avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.avatar-btn.primary {
    background: #3b82f6;
    color: white;
}

.avatar-btn.primary:hover {
    background: #2563eb;
}

.avatar-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

@media (max-width: 767px) {
    .avatar-upload-section {
        flex-direction: column;
        text-align: center;
    }
    
    .avatar-preview {
        width: 80px;
        height: 80px;
    }
}

/* Form Styles */
.profile-form-group {
    margin-bottom: 20px;
}

.profile-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.profile-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Search Bar Styles */
.search-bar-container {
    margin-bottom: 16px;
}

.search-bar-container .relative {
    position: relative;
}

.search-bar-container input {
    padding-left: 40px;
    padding-right: 40px;
}

.search-bar-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

.search-bar-container .clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.search-bar-container .clear-search-btn:hover {
    color: #4b5563;
    background-color: #f3f4f6;
}

.search-bar-container .clear-search-btn.hidden {
    display: none;
}

/* Search Results Loading */
.search-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #d1d5db;
}

/* Content Image Upload Styles */
.content-image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.content-image-upload-area:hover {
    border-color: #2563eb;
    background-color: #f8fafc;
}

.content-image-upload-area.dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.content-image-preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 12px;
}

.content-image-preview-container {
    position: relative;
    display: inline-block;
    margin-top: 12px;
}

.content-image-preview-container .remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.content-image-preview-container .remove-image-btn:hover {
    background: #dc2626;
}

/* Upload Progress */
.upload-progress {
    margin-top: 12px;
}

.upload-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width 0.3s ease;
}

.profile-form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.profile-form-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

/* Chart Container */
.chart-container {
    min-height: 280px;
    max-height: 320px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    flex: 1;
    max-width: 100%;
}

/* Feedback Card */
.feedback-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #2563eb;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feedback-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}

.feedback-teacher-name {
    font-weight: 600;
    color: #1f2937;
}

.feedback-date {
    font-size: 13px;
    color: #6b7280;
}

.feedback-content {
    color: #4b5563;
    line-height: 1.6;
}

.feedback-rating {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.feedback-star {
    color: #fbbf24;
}

.feedback-star.empty {
    color: #d1d5db;
}

/* Course Enrollment Card */
.enrollment-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.enrollment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.enrollment-image {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.enrollment-info {
    flex: 1;
}

.enrollment-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.enrollment-meta {
    display: flex;
    gap: 16px;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .profile-sidebar {
        width: 240px;
    }
    
    .profile-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .profile-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 60;
        top: 0;
        height: 100vh;
    }
    
    .profile-sidebar.open {
        transform: translateX(0);
    }
    
    /* Reset sidebar user info padding on mobile */
    .sidebar-user-info {
        padding: 24px 20px;
    }
    
    .profile-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 80px; /* Account for header on mobile */
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card-value {
        font-size: 24px;
    }
    
    .stat-card-label {
        font-size: 12px;
    }
    
    .stat-card-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .stat-card-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .enrollment-card {
        flex-direction: column;
    }
    
    .enrollment-image {
        width: 100%;
        height: 150px;
    }
    
    /* Profile Card Responsive */
    .profile-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .profile-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .profile-card-title {
        font-size: 18px;
    }
    
    /* Table Responsive */
    .profile-table {
        font-size: 13px;
    }
    
    .profile-table th,
    .profile-table td {
        padding: 10px 8px;
    }
    
    /* Hide some columns on mobile */
    .profile-table .hide-mobile {
        display: none;
    }
    
    /* Admin action buttons */
    .admin-action-btn {
        padding: 8px 12px;
        font-size: 12px;
        width: 100%;
        text-align: center;
    }
    
    /* Form responsive */
    .profile-form-group {
        margin-bottom: 16px;
    }
    
    .profile-form-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Header on mobile */
    header .flex {
        padding: 0 8px;
    }
    
    header h1 {
        font-size: 16px !important;
    }
    
    #header-username {
        display: none !important;
    }
    
    /* Hide header completely on mobile for admin/profile */
    header {
        display: none !important;
    }
    
    /* Adjust content when header is hidden */
    .profile-content {
        padding-top: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .profile-card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .profile-card-title {
        font-size: 16px;
    }
    
    /* Sidebar user info */
    .sidebar-user-info {
        padding: 16px;
    }
    
    .sidebar-avatar,
    .sidebar-avatar-container {
        width: 60px;
        height: 60px;
    }
    
    .sidebar-avatar-icon {
        width: 36px;
        height: 36px;
    }
    
    .sidebar-username {
        font-size: 16px;
    }
    
    .sidebar-role {
        font-size: 12px;
    }
    
    .sidebar-menu-item {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .sidebar-section-title {
        padding: 12px 20px 6px;
        font-size: 11px;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Close button inside sidebar for mobile */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .sidebar-close-btn {
        display: flex;
    }
}

/* Table wrapper for horizontal scroll on mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Admin responsive for buttons group */
@media (max-width: 768px) {
    .admin-btn-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-btn-group .admin-action-btn {
        width: 100%;
    }
    
    /* Modal responsive */
    #modal-container > div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Schedule responsive */
    .schedule-filters .flex {
        flex-wrap: wrap;
    }
    
    .schedule-filter-select {
        min-width: 100%;
    }
    
    /* Timetable horizontal scroll */
    .schedule-timetable-wrapper {
        overflow-x: auto;
    }
}

/* Sidebar Toggle Button (Mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: #2563eb;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 70;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle.sidebar-open {
    display: none;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Logout Button */
.sidebar-logout {
    margin: 16px 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #9ca3af;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-text {
    color: #6b7280;
}

/* Admin Specific Styles */
.admin-action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.admin-action-btn.primary {
    background: #2563eb;
    color: #ffffff;
}

.admin-action-btn.primary:hover {
    background: #1d4ed8;
}

.admin-action-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.admin-action-btn.secondary:hover {
    background: #e5e7eb;
}

.admin-action-btn.danger {
    background: #fee2e2;
    color: #991b1b;
}

.admin-action-btn.danger:hover {
    background: #fecaca;
}

.admin-action-btn.warning {
    background: #fef3c7;
    color: #92400e;
}

.admin-action-btn.warning:hover {
    background: #fde68a;
}

.admin-action-btn.info {
    background: #dbeafe;
    color: #1e40af;
}

.admin-action-btn.info:hover {
    background: #bfdbfe;
}

/* Trash Badge */
.trash-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-menu-item {
    position: relative;
}

/* Status badge cancelled */
.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.cancelled::before {
    background: #ef4444;
}

/* Admin Table Improvements */
.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.profile-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
}

.profile-table tbody tr:hover {
    background: #f8fafc;
}

/* Card Header with Button */
.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Info Box */
.alert-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Modal Styles */
#modal-container {
    backdrop-filter: blur(4px);
}

#modal-container > div {
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Form Label and Input */
.profile-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.profile-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Stats Grid for Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
}

.stat-card.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ============================================= */
/* SCHEDULE TIMETABLE STYLES                      */
/* ============================================= */

/* Schedule Filters */
.schedule-filters {
    border: 1px solid #e5e7eb;
}

.schedule-filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.schedule-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.schedule-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-nav-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.schedule-nav-btn.primary {
    background: #1e40af;
    border-color: #1e40af;
    color: white;
}

.schedule-nav-btn.primary:hover {
    background: #1e3a8a;
}

.schedule-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #1e40af;
    border-radius: 6px;
    background: white;
    color: #1e40af;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-action-btn:hover {
    background: #1e40af;
    color: white;
}

/* Timetable Grid */
.schedule-timetable-wrapper {
    border: 2px solid #1e40af;
    border-radius: 8px;
    overflow: hidden;
}

.schedule-timetable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px;
}

.schedule-timetable thead {
    background: #1e40af;
    color: white;
}

.schedule-timetable th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.schedule-timetable th:last-child {
    border-right: none;
}

.schedule-timetable th .day-name {
    font-size: 14px;
    font-weight: 600;
}

.schedule-timetable th .day-date {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 2px;
}

.schedule-timetable th.period-col {
    width: 60px;
    background: #1e3a8a;
}

.schedule-timetable th.day-col {
    width: calc((100% - 60px) / 7);
}

.schedule-timetable tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.schedule-timetable tbody tr:last-child {
    border-bottom: none;
}

.schedule-timetable td {
    padding: 0;
    vertical-align: top;
    border-right: 1px solid #e5e7eb;
    height: 50px;
    position: relative;
    overflow: visible;
}

.schedule-timetable td:last-child {
    border-right: none;
}

.schedule-timetable td.period-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
    color: #1e40af;
    vertical-align: middle;
}

/* Schedule Item (Lịch học) */
.schedule-cell-item {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 1px;
    padding: 4px 6px;
    border-radius: 4px;
    color: white;
    font-size: 10px;
    line-height: 1.25;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.schedule-cell-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.schedule-cell-item .item-title {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.schedule-cell-item .item-code {
    font-weight: 500;
    opacity: 0.9;
}

.schedule-cell-item .item-info {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}

.schedule-cell-item .item-session {
    font-size: 10px;
    opacity: 0.85;
}

.schedule-cell-item .item-time {
    font-size: 10px;
    opacity: 0.9;
}

.schedule-cell-item .item-group {
    font-size: 10px;
    opacity: 0.85;
}

.schedule-cell-item .item-class {
    font-size: 10px;
    opacity: 0.85;
}

.schedule-cell-item .item-room {
    font-weight: 500;
    margin-top: 3px;
}

.schedule-cell-item .item-teacher {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.schedule-cell-item .item-email {
    font-size: 9px;
    opacity: 0.8;
    word-break: break-all;
}

.schedule-cell-item .item-link {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 10px;
    text-decoration: underline;
}

.schedule-cell-item .item-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Schedule Legend */
.schedule-legend {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Schedule Detail Modal */
.schedule-detail-modal {
    max-width: 500px;
}

.schedule-detail-modal h3 {
    color: #1e40af;
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.schedule-detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.schedule-detail-row:last-child {
    border-bottom: none;
}

.schedule-detail-label {
    width: 120px;
    font-weight: 500;
    color: #6b7280;
    flex-shrink: 0;
}

.schedule-detail-value {
    flex: 1;
    color: #1f2937;
}

/* Empty period cell */
.schedule-timetable td.empty-cell {
    background: #fafafa;
}

/* Current day highlight */
.schedule-timetable th.today {
    background: #059669;
}

.schedule-timetable td.today-col {
    background: #f0fdf4;
}

/* Print Styles */
@media print {
    .schedule-filters,
    .schedule-legend,
    .profile-sidebar,
    header {
        display: none !important;
    }
    
    .profile-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .schedule-timetable-wrapper {
        border: 1px solid #000;
    }
    
    .schedule-timetable {
        font-size: 10px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .schedule-timetable {
        min-width: 700px;
    }
    
    .schedule-cell-item {
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .schedule-cell-item .item-title {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .schedule-filters {
        flex-direction: column;
    }
    
    .schedule-filters .flex {
        flex-direction: column;
        width: 100%;
    }
    
    .schedule-filters .filter-group {
        width: 100%;
    }
    
    .schedule-filter-select {
        width: 100%;
    }
}
/* ==================== ENROLLMENT FILTER BUTTONS ==================== */
.enroll-filter-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.enroll-filter-btn:hover {
    background: #e5e7eb;
}

.enroll-filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Available course card */
.available-course-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.available-course-card:hover {
    transform: translateY(-2px);
}

/* Spinner small */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease-in-out infinite;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}