/* ============================================
   Dashboard & Communication Room Styles
   ============================================ */

/* Dashboard Layout */
.dashboard-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 3rem;
}

/* Dashboard Hero */
.dashboard-hero {
    background: linear-gradient(135deg, #0d9488 0%, #065f46 50%, #064e3b 100%);
    padding: 2.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 0L60 30L30 60L0 30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.dashboard-hero .hero-content {
    position: relative;
    z-index: 2;
}

.dashboard-hero .greeting {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.dashboard-hero .user-name {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

.dashboard-hero .user-role {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    color: #fcd34d;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Dashboard Cards Container */
.dashboard-content {
    max-width: 1200px;
    margin: -2rem auto 0;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card .stat-info h4 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin: 0;
}

.stat-card .stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

/* Section Title */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-header h2 i {
    color: #0d9488;
}

/* Course Cards */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.course-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px var(--shadow-color);
}

.course-card .card-image {
    height: 160px;
    background: linear-gradient(135deg, #0d9488, #065f46);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.course-card .card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M20 0L40 20L20 40L0 20z'/%3E%3C/g%3E%3C/svg%3E");
}

.course-card .card-image i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.course-card .card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.course-card .card-badge.active {
    background: #22c55e;
    color: white;
}

.course-card .card-badge.pending {
    background: #eab308;
    color: white;
}

.course-card .card-body {
    padding: 1.25rem;
}

.course-card .card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.course-card .card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.course-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.course-card .card-footer .teacher-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.empty-state .btn-explore {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.empty-state .btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
}

/* ============================================
   Communication Room Styles
   ============================================ */

/* Room List */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.room-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-color);
    border-color: #0d9488;
}

.room-card .room-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.room-card .room-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0d9488, #065f46);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.room-card .room-icon i {
    color: #fcd34d;
    font-size: 1.25rem;
}

.room-card .room-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.room-card .room-info .room-teacher {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.room-card .room-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.room-card .room-meta i {
    margin-left: 0.25rem;
    color: #0d9488;
}

/* Chat Interface */
.chat-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 280px);
    min-height: 500px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
}

.chat-header .chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header .chat-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.chat-header .chat-title .room-badge {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}

.chat-header .back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

.chat-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-primary);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

.message-bubble {
    max-width: 70%;
    padding: 0.875rem 1.125rem;
    border-radius: 1rem;
    position: relative;
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    align-self: flex-start;
    border-bottom-right-radius: 0.25rem;
}

.message-bubble.received {
    background: var(--bg-secondary);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

.message-bubble .msg-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.message-bubble .msg-text {
    font-size: 0.925rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.message-bubble .msg-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.375rem;
    text-align: left;
}

.message-bubble.sent .msg-time {
    text-align: left;
}

.message-bubble.received .msg-time {
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    padding: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.chat-input-area input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.925rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
    min-width: 0;
}

.chat-input-area input[type="text"]:focus {
    border-color: #0d9488;
}

.chat-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-tertiary, #f1f5f9);
    color: #64748b;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-action-btn:hover {
    background: #e2e8f0;
    color: #0d9488;
}

.chat-action-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse-record 1s ease-in-out infinite;
}

@keyframes pulse-record {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.chat-input-area .send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-input-area .send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.chat-input-area .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary, #f8fafc);
    border-bottom: 1px solid var(--border-color);
}

.file-preview img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.file-preview-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-preview-icon i {
    font-size: 1.25rem;
    color: #0d9488;
}

.file-preview-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-preview-remove {
    margin-right: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.file-preview-remove:hover {
    background: #dc2626;
}

/* Message Media */
.msg-media {
    margin-bottom: 0.375rem;
}

.msg-media img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.625rem;
    cursor: pointer;
    display: block;
    object-fit: contain;
}

.msg-media video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.625rem;
    display: block;
}

.msg-media .msg-audio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.msg-media .msg-audio i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.msg-media .msg-audio audio {
    max-width: 220px;
    height: 36px;
}

.msg-media .msg-file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.625rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    max-width: 100%;
    word-break: break-all;
}

.message-bubble.received .msg-file-link {
    background: var(--bg-tertiary, #f1f5f9);
    color: var(--text-primary);
}

.msg-file-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

.msg-file-link i {
    font-size: 1.25rem;
    color: #ef4444;
    flex-shrink: 0;
}

/* Chat Toast */
.chat-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-family: 'Cairo', sans-serif;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.chat-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Create Room Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content h3 i {
    color: #0d9488;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions .btn-modal {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-align: center;
}

.modal-actions .btn-create {
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
}

.modal-actions .btn-create:hover {
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.modal-actions .btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-actions .btn-cancel:hover {
    background: var(--border-color);
}

/* Profile Section */
.profile-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #065f46);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar i {
    font-size: 2rem;
    color: white;
}

.profile-details h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

/* Header Auth Buttons */
.header-auth-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-auth-btns .btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: #0d9488;
    border: 2px solid #0d9488;
    border-radius: 2rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.header-auth-btns .btn-login:hover {
    background: #0d9488;
    color: white;
}

.header-auth-btns .btn-register {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    border: none;
    border-radius: 2rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.header-auth-btns .btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.header-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-user-menu .user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #065f46);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
}

.header-user-menu .btn-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    color: #0d9488;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.header-user-menu .btn-dashboard-link:hover {
    background: rgba(13, 148, 136, 0.1);
}

.header-user-menu .btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.3s;
}

.header-user-menu .btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .dashboard-hero {
        padding: 2rem 0 3rem;
    }

    .dashboard-hero .user-name {
        font-size: 1.5rem;
    }

    .dashboard-hero .greeting {
        font-size: 1.25rem;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .chat-container {
        height: calc(100vh - 200px);
        min-height: 400px;
        border-radius: 0;
    }

    .message-bubble {
        max-width: 85%;
    }

    .chat-header {
        padding: 0.875rem 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-area {
        padding: 0.75rem 1rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .dashboard-content {
        padding: 0 1rem;
    }

    .quick-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-info h4 {
        font-size: 1.25rem;
    }

    .header-auth-btns {
        gap: 0.25rem;
    }

    .header-auth-btns .btn-login,
    .header-auth-btns .btn-register {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .header-user-menu .btn-dashboard-link span,
    .header-user-menu .btn-logout span {
        display: none;
    }
}

@media (max-width: 360px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

/* Empty Chat State */
.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
    padding: 2rem;
}

/* ============================================
   Admin Dashboard Styles
   ============================================ */

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

/* Section Header */
.section-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: #0d9488;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.admin-tab {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.admin-tab:hover {
    background: rgba(13, 148, 136, 0.1);
    color: #0d9488;
}

.admin-tab.active {
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

/* Section Card */
.admin-section-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

/* Form Grid */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-grid .form-group[style*="grid-column"] {
        grid-column: auto !important;
    }
}

/* Admin Form inherit auth form styles */
.admin-form .form-group {
    margin-bottom: 0;
}

.admin-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-form .form-group label i {
    color: #0d9488;
    margin-left: 0.25rem;
}

.admin-form .input-wrapper {
    position: relative;
}

.admin-form .input-wrapper input,
.admin-form .input-wrapper select {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}

.admin-form .input-wrapper input:focus,
.admin-form .input-wrapper select:focus {
    border-color: #0d9488;
}

.admin-form .input-wrapper .input-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Table */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    color: var(--text-primary);
}

.admin-table tbody tr:hover {
    background: rgba(13, 148, 136, 0.05);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge */
.admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: #fff;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Delete Button */
.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* Reset Password Button */
.btn-reset-pass {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: #d97706;
    border: 1px solid #d97706;
    border-radius: 0.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 0.25rem;
}

.btn-reset-pass:hover {
    background: #d97706;
    color: white;
}

/* Alert */
.admin-alert {
    display: none;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.admin-alert.show {
    display: block;
}

.admin-alert.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.admin-alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Dark Mode - الوضع الداكن
   ============================================ */

/* --- Dashboard Page Background --- */
[data-theme="dark"] .dashboard-page {
    background: #0f172a;
}

/* --- Dashboard Hero --- */
[data-theme="dark"] .dashboard-hero {
    background: linear-gradient(135deg, #134e4a 0%, #064e3b 50%, #022c22 100%);
}

/* --- Stat Cards --- */
[data-theme="dark"] .stat-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .stat-card .stat-info h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .stat-card .stat-info p {
    color: #94a3b8;
}

/* --- Section Header --- */
[data-theme="dark"] .section-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .section-header h2 {
    color: #f1f5f9;
}

[data-theme="dark"] .section-header h2 i {
    color: #2dd4bf;
}

/* --- Course Cards --- */
[data-theme="dark"] .course-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .course-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .course-card .card-body h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .course-card .card-body p {
    color: #94a3b8;
}

[data-theme="dark"] .course-card .card-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .course-card .card-footer .teacher-name {
    color: #94a3b8;
}

/* --- Empty State --- */
[data-theme="dark"] .empty-state {
    color: #64748b;
}

/* --- Room Cards --- */
[data-theme="dark"] .room-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .room-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: #2dd4bf;
}

[data-theme="dark"] .room-card .room-info h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .room-card .room-info .room-teacher {
    color: #94a3b8;
}

[data-theme="dark"] .room-card .room-meta {
    color: #94a3b8;
}

[data-theme="dark"] .room-card .room-meta i {
    color: #2dd4bf;
}

/* --- Chat Interface --- */
[data-theme="dark"] .chat-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .chat-header {
    background: linear-gradient(135deg, #134e4a, #064e3b);
}

[data-theme="dark"] .chat-messages {
    background: #0f172a;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .message-bubble.sent {
    background: linear-gradient(135deg, #0f766e, #115e59);
}

[data-theme="dark"] .message-bubble.received {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

[data-theme="dark"] .chat-input-area {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] .chat-input-area input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .chat-input-area input:focus {
    border-color: #2dd4bf;
}

[data-theme="dark"] .chat-input-area input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .chat-input-area .send-btn {
    background: linear-gradient(135deg, #0f766e, #115e59);
}

/* --- Empty Chat --- */
[data-theme="dark"] .empty-chat {
    color: #64748b;
}

/* --- Modal --- */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
    background: #1e293b;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-content h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .modal-content h3 i {
    color: #2dd4bf;
}

[data-theme="dark"] .modal-actions .btn-cancel {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-actions .btn-cancel:hover {
    background: #475569;
}

/* --- Profile Section --- */
[data-theme="dark"] .profile-section {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .profile-details h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .profile-details p {
    color: #94a3b8;
}

/* --- Header Auth Buttons --- */
[data-theme="dark"] .header-auth-btns .btn-login {
    color: #2dd4bf;
    border-color: #2dd4bf;
}

[data-theme="dark"] .header-auth-btns .btn-login:hover {
    background: #2dd4bf;
    color: #0f172a;
}

[data-theme="dark"] .header-user-menu .btn-dashboard-link {
    color: #2dd4bf;
}

[data-theme="dark"] .header-user-menu .btn-dashboard-link:hover {
    background: rgba(45, 212, 191, 0.1);
}

[data-theme="dark"] .header-user-menu .btn-logout {
    color: #f87171;
}

[data-theme="dark"] .header-user-menu .btn-logout:hover {
    background: rgba(248, 113, 113, 0.1);
}

/* --- Admin Tabs --- */
[data-theme="dark"] .admin-tabs {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .admin-tab {
    color: #94a3b8;
}

[data-theme="dark"] .admin-tab:hover {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
}

[data-theme="dark"] .admin-tab.active {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(15, 118, 110, 0.4);
}

/* --- Admin Section Card --- */
[data-theme="dark"] .admin-section-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* --- Admin Form --- */
[data-theme="dark"] .admin-form .form-group label {
    color: #e2e8f0;
}

[data-theme="dark"] .admin-form .form-group label i {
    color: #2dd4bf;
}

[data-theme="dark"] .admin-form .input-wrapper input,
[data-theme="dark"] .admin-form .input-wrapper select {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .admin-form .input-wrapper input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .admin-form .input-wrapper input:focus,
[data-theme="dark"] .admin-form .input-wrapper select:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

[data-theme="dark"] .admin-form .input-wrapper .input-icon {
    color: #64748b;
}

/* --- Admin Table --- */
[data-theme="dark"] .admin-table-wrap {
    border-color: #334155;
}

[data-theme="dark"] .admin-table th {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: #ffffff;
}

[data-theme="dark"] .admin-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .admin-table tbody tr:hover {
    background: rgba(45, 212, 191, 0.05);
}

/* --- Admin Badge --- */
[data-theme="dark"] .admin-badge {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: #ccfbf1;
}

/* --- Delete Button --- */
[data-theme="dark"] .btn-delete {
    color: #f87171;
    border-color: #f87171;
    background: transparent;
}

[data-theme="dark"] .btn-delete:hover {
    background: #f87171;
    color: #0f172a;
}

/* --- Reset Password Button --- */
[data-theme="dark"] .btn-reset-pass {
    color: #fbbf24;
    border-color: #fbbf24;
    background: transparent;
}

[data-theme="dark"] .btn-reset-pass:hover {
    background: #fbbf24;
    color: #0f172a;
}

/* --- Admin Alert --- */
[data-theme="dark"] .admin-alert.success {
    background: rgba(45, 212, 191, 0.1);
    color: #5eead4;
    border-color: rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .admin-alert.error {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.2);
}

/* --- Quick Stats Icon Colors in Dark Mode --- */
[data-theme="dark"] .stat-icon {
    opacity: 0.95;
}

/* --- General form inputs inside dark dashboard --- */
[data-theme="dark"] .dashboard-page input,
[data-theme="dark"] .dashboard-page textarea,
[data-theme="dark"] .dashboard-page select {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

[data-theme="dark"] .dashboard-page input::placeholder,
[data-theme="dark"] .dashboard-page textarea::placeholder {
    color: #64748b;
}

[data-theme="dark"] .dashboard-page input:focus,
[data-theme="dark"] .dashboard-page textarea:focus,
[data-theme="dark"] .dashboard-page select:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
    background: #1e293b;
}

/* --- Auth button in dashboard dark mode --- */
[data-theme="dark"] .btn-auth {
    background: linear-gradient(135deg, #0f766e, #115e59);
}

[data-theme="dark"] .btn-auth:hover {
    box-shadow: 0 10px 30px rgba(15, 118, 110, 0.4);
}