body { font-family: 'Tajawal', sans-serif; transition: background-color 0.5s ease, color 0.5s ease; }

/* تخصيص الـ Themes بناءً على الاختيارات المحددة */
/* الأزرق */
.theme-blue-light { --primary: #2563eb; --primary-hover: #1d4ed8; --bg: #f8fafc; --panel: #ffffff; --text: #1e293b; --primary-rgb: 37, 99, 235; --panel-rgb: 255, 255, 255; }
.theme-blue-dark { --primary: #3b82f6; --primary-hover: #2563eb; --bg: #0f172a; --panel: #1e293b; --text: #f8fafc; --primary-rgb: 59, 130, 246; --panel-rgb: 30, 41, 59; }

/* الزهري */
.theme-pink-light { --primary: #db2777; --primary-hover: #be185d; --bg: #fff1f2; --panel: #ffffff; --text: #4c0519; --primary-rgb: 219, 39, 119; --panel-rgb: 255, 255, 255; }
.theme-pink-dark { --primary: #f472b6; --primary-hover: #db2777; --bg: #1c0512; --panel: #2d0d21; --text: #ffe4e6; --primary-rgb: 244, 114, 182; --panel-rgb: 45, 13, 33; }

/* الزمردي */
.theme-emerald-light { --primary: #059669; --primary-hover: #047857; --bg: #f0fdf4; --panel: #ffffff; --text: #064e3b; --primary-rgb: 5, 150, 105; --panel-rgb: 255, 255, 255; }
.theme-emerald-dark { --primary: #10b981; --primary-hover: #059669; --bg: #022c22; --panel: #064e3b; --text: #ecfdf5; --primary-rgb: 16, 185, 129; --panel-rgb: 6, 78, 59; }

/* الكهرماني */
.theme-amber-light { --primary: #d97706; --primary-hover: #b45309; --bg: #fffbeb; --panel: #ffffff; --text: #78350f; --primary-rgb: 217, 119, 6; --panel-rgb: 255, 255, 255; }
.theme-amber-dark { --primary: #f59e0b; --primary-hover: #d97706; --bg: #451a03; --panel: #78350f; --text: #fffbeb; --primary-rgb: 245, 158, 11; --panel-rgb: 120, 53, 15; }

/* البنفسجي */
.theme-violet-light { --primary: #7c3aed; --primary-hover: #6d28d9; --bg: #f5f3ff; --panel: #ffffff; --text: #2e1065; --primary-rgb: 124, 58, 237; --panel-rgb: 255, 255, 255; }
.theme-violet-dark { --primary: #8b5cf6; --primary-hover: #7c3aed; --bg: #1e1b4b; --panel: #2e1065; --text: #f5f3ff; --primary-rgb: 139, 92, 246; --panel-rgb: 46, 16, 101; }

/* الرمادي */
.theme-slate-light { --primary: #475569; --primary-hover: #334155; --bg: #f1f5f9; --panel: #ffffff; --text: #0f172a; --primary-rgb: 71, 85, 105; --panel-rgb: 255, 255, 255; }
.theme-slate-dark { --primary: #94a3b8; --primary-hover: #64748b; --bg: #0f172a; --panel: #1e293b; --text: #f8fafc; --primary-rgb: 148, 163, 184; --panel-rgb: 30, 41, 59; }

/* توافق مع الكلاسات القديمة */
.theme-boy-light { --primary: #2563eb; --primary-hover: #1d4ed8; --bg: #f8fafc; --panel: #ffffff; --text: #1e293b; --primary-rgb: 37, 99, 235; --panel-rgb: 255, 255, 255; }
.theme-boy-dark { --primary: #3b82f6; --primary-hover: #2563eb; --bg: #0f172a; --panel: #1e293b; --text: #f8fafc; --primary-rgb: 59, 130, 246; --panel-rgb: 30, 41, 59; }
.theme-girl-light { --primary: #db2777; --primary-hover: #be185d; --bg: #fff1f2; --panel: #ffffff; --text: #4c0519; --primary-rgb: 219, 39, 119; --panel-rgb: 255, 255, 255; }
.theme-girl-dark { --primary: #f472b6; --primary-hover: #db2777; --bg: #1c0512; --panel: #2d0d21; --text: #ffe4e6; --primary-rgb: 244, 114, 182; --panel-rgb: 45, 13, 33; }

/* القوائم والتحريكات */
#user-dropdown, #theme-dropdown {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.animate-pulse-slow {
    animation: pulse-slow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

body { background-color: var(--bg); color: var(--text); overflow-x: hidden; }

/* Glassmorphism Effect */
.glass-panel {
    background: rgba(var(--panel-rgb), 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--panel-rgb), 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* المؤقت الدراسي المطور */
.timer-container {
    background: linear-gradient(135deg, rgba(var(--panel-rgb), 0.8), rgba(var(--panel-rgb), 0.4));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

#timer-display {
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

/* المكونات الأساسية */
.custom-panel { 
    background-color: var(--panel); 
    border: 1px solid rgba(0,0,0,0.05); 
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white; 
    padding: 0.85rem 1.5rem;
    border-radius: 1rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 14px 0 rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.text-primary { color: var(--primary); }

/* تنسيقات مخصصة للعناصر المتكررة */
.setup-step-card {
    padding: 1.5rem;
    background: var(--panel);
    border: 2px solid rgba(0,0,0,0.05);
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.setup-step-card:hover { 
    border-color: var(--primary); 
    background-color: rgba(var(--primary-rgb), 0.05);
    transform: scale(1.05);
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 2px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 1rem;
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.input-field::placeholder {
    color: var(--text);
    opacity: 0.4;
}

.input-field:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    background: var(--panel);
}

/* تحسين وضوح التسميات (Labels) */
.setup-step label {
    color: var(--text) !important;
    opacity: 0.6 !important; /* زيادة الوضوح من 0.4 إلى 0.6 */
    font-weight: 800;
}

.setup-step p {
    color: var(--text);
    opacity: 0.8;
}

.tab-nav-btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 1rem;
    background-color: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.05);
    font-size: 0.9rem;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.list-item:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    transform: translateX(-4px);
}

.post-card {
    background-color: var(--panel);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 1.25rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: right;
    transition: all 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* التنبيهات */
.alert-modal-content {
    background-color: var(--panel);
    color: var(--text);
    border-radius: 2rem;
    padding: 2rem;
    max-width: 26rem;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

#custom-alert h3 { color: var(--text); }
#custom-alert p { color: var(--text); opacity: 0.7; }

/* تحسين وضوح الأيقونات والنصوص في الوضع النهاري */
html:not(.dark) .fa-chevron-down,
html:not(.dark) .fa-ellipsis-vertical {
    color: #000000 !important;
    opacity: 0.6 !important;
}

html:not(.dark) thead tr {
    color: #000000 !important;
}

html:not(.dark) .opacity-40, 
html:not(.dark) .opacity-30 {
    color: #000000 !important;
    opacity: 0.5 !important;
}

html:not(.dark) #welcome-name {
    color: #000000;
}

#image-lightbox.show {
    display: flex;
    opacity: 1;
}

#image-lightbox.show img {
    transform: scale(1);
}

/* Custom Scrollbar */
::-webkit-scrollbar, .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track, .custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb, .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover, .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.4);
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.2) transparent;
}
