/* Force Font Awesome to load */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* AI Helper minimal styles */
.ai-helper-badge:hover { transform: translateY(-1px); box-shadow: 0 2px 10px rgba(29,78,216,0.25); }
/* Mobile/desktop title swap for Question Analysis */
.qa-desktop { display: inline; }
.qa-mobile { display: none; }
@media (max-width: 640px) {
  .qa-desktop { display: none; }
  .qa-mobile { display: inline; }
}

/* Reduce Ai Helper badge and Points badge font-size 7% on very small phones */
@media (max-width: 360px) {
  .ai-helper-badge { font-size: 12.07px !important; }
  #question-points span { font-size: 88% !important; }
  /* Ensure icon also scales down */
  #question-points i { font-size: calc(1em + 1.5px) !important; }
}

/* Normalize badge font weight/size across Helper, Points, Report */
.ai-helper-badge,
#question-points,
#report-question-btn .report-text {
  font-size: 12.97px !important;
  font-weight: 700 !important;
}

/* Reduce Badge Points text by ~5% */
#question-points span { font-size: 95% !important; }

/* Emphasize correct answer box */
#ai-answer-box {
  border: 1px solid #16a34a !important;
  background:rgb(206, 243, 226) !important;
  color: #065f46 !important;
}
.ai-option-box { transition: background .2s ease; }
.ai-option-box:hover { background:#f9fafb; }
.ai-option-box + .ai-option-box { margin-top: 5% !important; }
.ai-helper-popup .ai-option-box.is-wrong, #ai-helper-popup .ai-option-box.is-wrong {
  border-color:rgb(226, 124, 124) !important;
}
.ai-helper-popup { font-family: 'Cairo', sans-serif !important; }
.ai-rtl { font-family: 'Cairo', sans-serif !important; direction: rtl; text-align: right; }
.ai-en { font-family: 'Poppins', sans-serif !important; direction: ltr; text-align: left; }
/* Mobile-only: reduce option explanation font size by 4% (phones ≤720px) */
@media (max-width: 720px) {
  #ai-helper-popup .ai-option-box .ai-rtl { font-size: 96% !important; }
}
@media (max-width: 720px) {
  #ai-welcome { font-size: 94% !important; }
  /* Hide helper phrase on mobile by leaving only Hello + Name + emoji */
  /* The phrase is suppressed from JS, this ensures spacing stays compact */
}
/* Responsive font scaling for analysis and solution */
@media (max-width: 640px) {
  #ai-analysis-text, #ai-solution-box { font-size: 93% !important; }
}
@media (min-width: 641px) {
  #ai-analysis-text, #ai-solution-box { font-size: 97% !important; }
}

/* Add vertical spacing between popup sections */
.ai-space { margin-bottom: 5% !important; }

/* Darken popup borders ~5% */
#ai-welcome,
#ai-question-box,
#ai-analysis-box,
#ai-solution-box,
#ai-answer-box,
.ai-option-box {
  border-color: #c4cbd3 !important;
}

/* Ensure bold text renders properly inside the popup question */
#ai-helper-popup #ai-question-box strong,
#ai-helper-popup #ai-question-box b {
  font-weight: 700 !important;
}
/* Slightly larger question text inside popup */
#ai-helper-popup #ai-question-html { font-size: 104% !important; }
#ai-helper-popup #ai-question-title { font-size: 95% !important; }
/* Popup question box background and left border for better distinction */
#ai-helper-popup #ai-question-box { border-left: 3px solid rgb(58, 129, 228) !important; }
#ai-helper-popup #ai-question-html { background: #f2f9ff !important; }
.ai-skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f1f5f9 37%, #e5e7eb 63%);
    background-size: 400% 100%;
    animation: aiSkeletonShimmer 1.2s ease-in-out infinite;
}
@keyframes aiSkeletonShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* Inline loader spin */
@keyframes aiSpin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }

/* Fix Font Awesome icons */
.fa, .fas, .far, .fal, .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Ensure icons display */
.label-icon, .btn-icon {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

/* Slightly enlarge Question n/n badge globally */
#question-counter { font-size: 73% !important; }


/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fix scroll issue for exam results page */
body.exam-results-page {
    overflow-x: hidden;
    position: relative;
}

html.exam-results-page {
    overflow-x: hidden;
}

/* Ensure exam results container doesn't cause horizontal scroll */
.exam-results-container {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Login Form New Design */
.exam-system-container {
    font-family: 'Cairo', sans-serif;
    background: #f5f7fa;
    min-height: 92vh;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
    padding: 20px;
    margin: 0;
    max-width: none;
}

.login-container {
    background: #ffffff;
    border-radius: 25px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Desktop Layout - Two Column Design */
@media (min-width: 1024px) {
    .exam-system-container {
        min-height: 100vh;
        align-items: stretch;
        padding: 0%;
    }
    
    .login-container {
        max-width: none;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        display: flex;
        position: relative;
    }
    
    /* Left Section - Header */
    .header-section {
        width: 50%;
        padding: 30px 50px; /* تقليل من 48px إلى 30px (تقليل كبير من الأعلى والأسفل) */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 30%, #1f1f1f 70%, #0d0d0d 100%);
        position: relative;
        border-radius: 20px;
        margin: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        overflow: hidden;
    }
    
    /* Right Section - Form */
    .form-section {
        width: 50%;
        padding: 35px 50px; /* تقليل من 60px إلى 35px (تقليل كبير من الأعلى والأسفل) */
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: #ffffff;
    }
    
    .main-title {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .logo {
        width: 150px;
    }
    
    .logo-glow {
        width: 300px;
        height: 180px;
    }
}

/* Extra Large Screens */
@media (min-width: 1440px) {
    .header-section {
        padding: 40px 70px; /* تقليل من 64px إلى 40px (تقليل كبير من الأعلى والأسفل) */
    }
    
    .form-section {
        padding: 45px 70px; /* تقليل من 80px إلى 45px (تقليل كبير من الأعلى والأسفل) */
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .logo {
        width: 170px;
    }
}

.header-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 30%, #1f1f1f 70%, #0d0d0d 100%);
    padding: 50px 40px; /* هذا للهاتف - يبقى كما هو */
    text-align: center;
    position: relative;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(45, 45, 45, 0.9) 30%, rgba(31, 31, 31, 0.9) 70%, rgba(13, 13, 13, 0.95) 100%);
}

.logo-container {
    position: relative;
    z-index: 3;
    margin-bottom: 12px; /* تقليل من 15px إلى 12px (20% أقل) */
    display: inline-block;
}

.logo {
    width: 130px;
    height: auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 150px;
    background: radial-gradient(ellipse, rgba(220, 38, 127, 0.2) 0%, rgba(220, 38, 127, 0.1) 30%, rgba(220, 38, 127, 0.05) 60%, transparent 80%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(20px);
}

.main-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px; /* تقليل من 15px إلى 12px (20% أقل) */
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.7;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.form-section {
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
}
.email-input-container {
    width: 100%;
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100%;
}

.email-input {
    width: 100% !important;
    padding: 16px 55px 16px 20px !important; /* مساحة للأيقونة من الي */
    border: 2px solid #373A3F !important; /* تغيير من #e2e8f0 إلى رصاصي أغمق */
    border-radius: 14px !important;
    font-size: 1rem !important;
    font-family: 'Cairo', sans-serif !important;
    color: #373A3F !important;
    background: #ffffff !important;
    transition: all 0.3s ease !important;
    direction: rtl !important;
    text-align: right !important;
    outline: none !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important; /* إضافة line-height للمحاذاة */
}

.input-icon {
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #373A3F !important;
    font-size: 1.1rem !important;
    z-index: 10 !important;
    pointer-events: none !important;
    transition: color 0.3s ease !important;
    height: 1em !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
}

.email-input:focus {
    border-color: #1a1a1a !important;
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.1) !important;
}

.email-input:focus + .input-icon {
    color: #1a1a1a !important;
}

.email-input:valid + .input-icon {
    color: #10b981 !important;
}

.email-input:invalid:not(:placeholder-shown) + .input-icon {
    color: #ef4444 !important;
}

.email-input::placeholder {
    color: #94a3b8 !important;
    text-align: right !important;
    direction: rtl !important;
}
/* Fix label alignment */
.form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
    font-size: 1rem;
    direction: rtl;
    justify-content: flex-start;
}

.label-icon {
    color: #1a1a1a;
    font-size: 1.1rem;
    order: 1;
}

.email-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}
/* Updated form styles to match design exactly */
.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

/* Remove autofill background for regular form inputs */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: inherit !important;
    background: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.1);
    background: #ffffff;
}

.form-input::placeholder {
    color: #94a3b8;
    text-align: right;
    direction: rtl;
}

.info-section {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.1) 0%, rgba(45, 45, 45, 0.1) 100%);
    border: 1px solid rgba(26, 26, 26, 0.2);
    border-radius: 14px;
    padding: 18px;
    margin: 25px 0;
    text-align: center;
}

.info-text {
    color: #475569;
    font-size: 1rem;
	 font-weight: 600;
    line-height: 1.9;
    margin: 0;
}

/* Fix button design */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    border: none;
    padding: 18px 24px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(26, 26, 26, 0.4);
    direction: rtl;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(26, 26, 26, 0.5);
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

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

.submit-btn:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-icon {
    margin-left: 10px;
    font-size: 1.1rem;
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Input validation states */
.form-input:valid {
    border-color: #e5e7eb;
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

/* Success Popup Styles - Fixed Centering */
.exam-success-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    animation: fadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-success-popup {
    position: relative;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(40, 167, 69, 0.3);
    text-align: center;
    min-width: 350px;
    max-width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: popupSlideIn 0.5s ease-out;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.exam-success-popup .popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.exam-success-popup .popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.exam-success-popup .popup-message {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.4;
}

.exam-success-popup .popup-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.exam-success-popup .popup-progress-bar {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    animation: progressBar 2s linear;
}

/* Animations */
@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    0% { 
        opacity: 0;
    }
    100% { 
        opacity: 1;
    }
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes popupSlideOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.exam-success-popup.slide-out {
    animation: popupSlideOut 0.3s ease-in;
}

/* Error Popup Styles */
.exam-error-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-error-popup {
    position: relative;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(220, 53, 69, 0.3);
    text-align: center;
    min-width: 350px;
    max-width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: popupSlideIn 0.5s ease-out;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.exam-error-popup .popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.exam-error-popup .popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.exam-error-popup .popup-message {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.4;
}

.exam-error-popup .popup-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.exam-error-popup .popup-progress-bar {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    animation: progressBar 2s linear;
}

.exam-error-popup.slide-out {
    animation: popupSlideOut 0.3s ease-in;
}

/* Responsive Error Popup */
@media (max-width: 480px) {
    .exam-error-popup {
        min-width: 300px;
        max-width: 85%;
        padding: 25px 30px;
        margin: 20px;
    }

    .exam-error-popup .popup-icon {
        font-size: 40px;
    }

    .exam-error-popup .popup-title {
        font-size: 1.3rem;
    }

    .exam-error-popup .popup-message {
        font-size: 1rem;
    }
}

/* Reset styles for other pages */
.exam-system-container:not(:has(.login-container)) {
    max-width: none;
    padding: 0;
    background: #f2f3f3;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    min-height: auto;
    display: block;
}

/* سين Header ليكون أغر ومرتب */
.exam-header-new {
    background: #ffffff;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 50px;
}

.welcome-section h1 {
    font-size: 1.33rem; /* تقليل 5% من 1.4rem */
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    font-family: 'Cairo', sans-serif;
    line-height: 1.2;
}

.welcome-section p {
    color: #64748b;
    font-size: 0.85rem;
    font-family: 'Cairo', sans-serif;
    margin: 0 0 0.034rem 0; /* إضافة 4% margin من الأسفل */
}

.logout-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cairo', sans-serif;
    height: 36px;
}

.logout-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.main-content-new {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.filters-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.filters-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981, #f59e0b);
    z-index: 1;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
    position: relative;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.filter-title i {
    color: #3b82f6;
    font-size: 1.1rem;
    animation: filterIconPulse 2s ease-in-out infinite;
}

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

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    position: relative;
    padding: 5px;
}

/* تأثير خلفية للـ filter buttons container */
.filter-buttons::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), rgba(226, 232, 240, 0.3));
    border-radius: 15px;
    z-index: -1;
}

    .filter-btn {
        background: #f1f5f9;
        color: #64748b;
        border: 2px solid #e2e8f0;
        padding: 11px 18px; /* تقليل 8% من 12px 20px */
        border-radius: 25px;
        font-size: 1.0773rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: 'Cairo', sans-serif;
    }

.filter-btn:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* تأثيرات للـ badges غير المفعلة */
.filter-btn:not(.active) {
    position: relative;
    transition: all 0.3s ease;
}

.filter-btn:not(.active):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    font-weight: 700;
}

/* إضافة تأثير بصري للـ badge المفعل */
.filter-btn.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8, #3b82f6);
    border-radius: 27px;
    z-index: -1;
    animation: activeGlow 2s ease-in-out infinite alternate;
}

@keyframes activeGlow {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* إضافة أيقونة للـ badge المفعل */
.filter-btn.active::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #10b981;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Badge "لم يتم حلها" - بنفسجي متدرج */
.filter-btn[data-category="unsolved"] {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: #8b5cf6;
}

.filter-btn[data-category="unsolved"]:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.filter-btn[data-category="unsolved"]:not(.active):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.25);
}

.filter-btn[data-category="unsolved"].active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    position: relative;
    font-weight: 700;
}

/* تأثير خاص لـ badge "لم يتم حلها" المفعل */
.filter-btn[data-category="unsolved"].active::before {
    background: linear-gradient(45deg, #8b5cf6, #7c3aed, #8b5cf6);
}

.filter-btn[data-category="unsolved"].active::after {
    background: #10b981;
    border: 1px solid white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Badge "إضافة امتحان" - أزرق غامق متدرج */
.filter-btn[data-category="add_exam"] {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    border-color: #1e40af;
}

.filter-btn[data-category="add_exam"]:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e293b);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.filter-btn[data-category="add_exam"]:not(.active):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.25);
}

.filter-btn[data-category="add_exam"].active {
    background: linear-gradient(135deg, #1e3a8a, #1e293b);
    color: white;
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    position: relative;
    font-weight: 700;
}

/* تأثير خاص لـ badge "إضافة امتحان" المفعل */
.filter-btn[data-category="add_exam"].active::before {
    background: linear-gradient(45deg, #1e40af, #1e3a8a, #1e40af);
}

.filter-btn[data-category="add_exam"].active::after {
    background: #dc2626;
    border: 1px solid white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* إضافة علامة plus لـ badge "إضافة امتحان" بشكل دائم */
.filter-btn[data-category="add_exam"]::after {
    content: '+';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e40af;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
    z-index: 10;
    line-height: 1;
    text-align: center;
}

.exams-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.exam-card-new {
    background: #ffffff;
    border: 1px solid #bcbfdb !important;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.08),
        0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.exam-card-new:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.06);
}

/* عكس اتا ظ في صورة المتان */
.exam-image-new {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* عكس اظل - قي من فوق وضيف م تحت */
    box-shadow: 
        inset 0 10px 15px -10px rgba(0,0,0,0.1),   /* ظ فيف م فوق */
        inset 0 -20px 30px -10px rgba(0,0,0,0.3),  /* ظل وي ن تحت */
        0 4px 15px rgba(0,0,0,0.1);               /* ظل خارجي */
}


.exam-image-new.no-image::before {
    content: '📊';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    opacity: 0.3;
}

/* حدي ال overlay لظل العكوس */
.exam-image-new::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
}

.exam-content-new {
    padding: 25px;
}

.exam-title-new {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
}

.exam-description-new {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: 'Cairo', sans-serif;
}

/* تحسين الإحئيات مع divider في امنتصف */
.exam-stats-new {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

/* Divider في لمنتصف */
.exam-stats-new::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

.stat-item-new {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.stat-item-new:not(:last-child) {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
}

.stat-icon-new {
    color: #3b82f6;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.stat-number-new {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    font-family: 'Cairo', sans-serif;
}

.stat-label-new {
    font-size: 0.88rem; /* زيادة 10% من 0.8rem */
    color: #64748b;
    font-family: 'Cairo', sans-serif;
}

.exam-category-new {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(30, 41, 59, 0.9) !important;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.689rem;
    font-weight: 700;
    margin-bottom: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 28px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

.start-exam-btn-new {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
}

.start-exam-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.show-result-btn-new {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.show-result-btn-new:hover {
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.4);
}

/* General Exam System Styles */
.exam-btn {
    background: #007cba;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.exam-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.exam-btn-secondary {
    background: #6c757d;
}

.exam-btn-secondary:hover {
    background: #545b62;
}

.exam-btn-success {
    background: #28a745;
}

.exam-btn-success:hover {
    background: #1e7e34;
}

.exam-btn-danger {
    background: #dc3545;
}

.exam-btn-danger:hover {
    background: #c82333;
}

/* Header bar for logout */
.exam-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.exam-header-bar h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Exam List */
.exam-filters {
    margin-bottom: 30px;
    text-align: center;
}

.exam-filter-btn {
    background: #f8f9fa;
    color: #495057;
    padding: 8px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.exam-filter-btn.active,
.exam-filter-btn:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.exam-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Update exam card image with gradient shadow */
.exam-card-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 12px 12px 0 0;
    /* Gradient shadow: light from top, stronger from bottom */
    box-shadow: 
        inset 0 10px 15px -10px rgba(0,0,0,0.1),  /* Light shadow from top */
        inset 0 -20px 30px -10px rgba(0,0,0,0.3), /* Stronger shadow from bottom */
        0 4px 15px rgba(0,0,0,0.1);              /* External shadow */
    overflow: hidden;
}

/* Fallback gradient when no image */
.exam-card-image.no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.exam-card-content {
    padding: 25px;
}

.exam-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-card-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 15.73px;
    color: #888;
}

.exam-card-category {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.exam-card-actions {
    text-align: center;
}

/* Paused exam button state */
.paused-exam-btn-new {
    background: #16a34a !important; /* green */
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.95;
}

/* Exam Page */
.exam-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.exam-title {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-description {
    font-size: 18px;
    opacity: 0.9;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-progress {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 20px;
    overflow: hidden;
}

.exam-progress-fill {
    height: 100%;
    background: #007cba;
    transition: width 0.3s ease;
}

/* Fix text overflow issues */
.exam-question {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.exam-question-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 20px 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.exam-options {
    list-style: none;
    padding: 0;
}

.exam-option {
    margin-bottom: 15px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix long text in options */
.exam-option label {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.exam-option label:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.exam-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 2px;
    transform: scale(1.2);
    flex-shrink: 0;
}

.exam-option.selected label {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.exam-option.correct label {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.exam-option.incorrect label {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Navigation buttons responsive */
.exam-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

.exam-navigation .exam-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* Results */
.exam-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.exam-score {
    font-size: 48px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 20px;
}

.exam-grade-message {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.exam-explanation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
}

.exam-explanation-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.exam-explanation-text {
    color: #666;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Loading and Messages */
.exam-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.exam-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.exam-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal */
.exam-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.exam-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* تقليل عرض popup Finish Exam على شاشات الكمبيوتر فقط */
@media (min-width: 769px) {
    .exam-modal-content {
        max-width: 390px;
    }
    
}

.exam-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.exam-modal-text {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exam-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Handle extremely long words */
.exam-question-text,
.exam-option label,
.exam-card-title,
.exam-card-description,
.exam-explanation-text {
    word-break: break-word;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Prevent horizontal scrolling */
.exam-question,
.exam-option,
.exam-system-container,
.exam-card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Accessibility */
input:focus,
button:focus {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}


/* Total Points Badge */
.exam-points-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.679rem; /* تصغير 1.5% من 0.689rem */
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Cairo', sans-serif;
    height: 28px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

/* تحدي اإحصائيا لتدعم 3 ناصر */
.exam-stats-new {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

/* Dividers بين لعناصر اثلاثة */
.exam-stats-new::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 33.33%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

.exam-stats-new::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 66.66%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

.stat-item-new {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.stat-item-new:not(:last-child) {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
}

/* Exam Timer Styles */
.exam-timer-container {
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 10px 20px;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo', sans-serif;
    color: #dc2626;
    font-weight: 600;
}

.exam-timer-container i {
    font-size: 1.2rem;
}

#exam-timer {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.timer-label {
    font-size: 0.9rem;
}

/* Time Up Popup Styles */
.exam-timeup-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-timeup-popup {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.timeup-icon {
    font-size: 4rem;
    color: #dc2626;
    margin-bottom: 20px;
}

.exam-timeup-popup h2 {
    color: #dc2626;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.exam-timeup-popup p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

#timeup-ok-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#timeup-ok-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

/* Name Input Popup */
.name-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.name-popup {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease-out;
}

.name-popup-header {
    text-align: center;
    margin-bottom: 25px;
}

.name-popup-header i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 15px;
}

.name-popup-header h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.name-popup-content p {
    color: #64748b;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.5;
}

.name-input {
    width: 100%;
    padding: 18px 24px; /* زيادة padding للراحة */
    border: 2px solid #e2e8f0;
    border-radius: 20px; /* زيادة الانحناء من 14px إلى 20px */
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    color: #1e293b;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%); /* خلفية متدرجة خفيفة */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* تحسين الحركة */
    margin-bottom: 20px;
    direction: rtl;
    text-align: right;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); /* ظل خفيف */
    position: relative;
}

.name-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
    transform: translateY(-1px); /* رفع خفيف عند التركيز */
}

.name-input:hover:not(:focus) {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
}

/* تحسين placeholder */
.name-input::placeholder {
    color: #94a3b8;
    text-align: right;
    direction: rtl;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.name-input:focus::placeholder {
    opacity: 0.5;
    transform: translateX(4px);
}

/* تأثير loading عند الإرسال */
.name-input.loading {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    cursor: wait;
    opacity: 0.8;
}

/* validation states */
.name-input.valid {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.name-input.invalid {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* إضافة تأثير ripple عند الضغط */
.name-input:active {
    transform: scale(0.998);
}

/* تحسين للشاشات الصغيرة */
@media (max-width: 768px) {
    .name-input {
        padding: 16px 20px;
        border-radius: 18px; /* انحناء أقل قليلاً للهواتف */
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .name-input {
        padding: 14px 18px;
        border-radius: 16px;
        font-size: 0.9rem;
    }
}

.confirm-name-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
}

.confirm-name-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.confirm-name-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Review Skipped Button */
.exam-btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.exam-btn-info:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

/* Mobile Optimizations for Exam Cards */
@media (max-width: 768px) {
    .exam-header-new {
        padding: 10px 16px;
    }
    
    .header-content {
        height: 45px;
    }
    
    .welcome-section h1 {
        font-size: 1.14rem; /* تقليل 5% من 1.2rem */
    }
    
    .welcome-section p {
        font-size: 0.8rem;
        margin: 0 0 0.032rem 0; /* إضافة 4% margin من الأسفل */
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        height: 32px;
    }
    
    .main-content-new {
        padding: 15px 12px;
    }
    
    .filters-section {
        padding: 14px;
        margin-bottom: 18px;
    }
    
    .exams-grid-new {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .exam-card-new {
        border-radius: 16px;
        margin-bottom: 15px;
    }
    
    /* Badge positioned on image - top right */
    .exam-image-new {
        position: relative;
        height: 160px;
        /* نف الل العكوس للهات */
        box-shadow: 
            inset 0 8px 12px -8px rgba(0,0,0,0.1),   /* خفيف من فوق */
            inset 0 -15px 25px -8px rgba(0,0,0,0.3), /* قوي من تحت */
            0 3px 12px rgba(0,0,0,0.1);
    }
}
    
    .exam-category-new {
        position: absolute;
        top: 12px;
        right: 12px;
        background: rgba(30, 41, 59, 0.9) !important;
        color: white;
        padding: 6px 12px;
        border-radius: 12px;
        font-size: 0.689rem;
        font-weight: 700;
        margin-bottom: 0;
        z-index: 2;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        height: 28px;
        line-height: 1.2;
        display: inline-flex;
        align-items: center;
    }
    
    /* Content adjustments */
    .exam-content-new {
        padding: 20px 16px;
    }
    
    /* Title and description improvements */
    .exam-title-new {
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 8px;
        color: #1e293b;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .exam-description-new {
        font-size: 0.85rem;
        line-height: 1.4;
        color: #64748b;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Stats side by side */
    .exam-stats-new {
        display: flex;
        justify-content: space-around;
        margin-bottom: 16px;
        padding: 12px;
        background: #f8fafc;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
    }
    
    /* للهتف - حسين اـ divider */
    .exam-stats-new::before {
        height: 50%;
    }
    
    .stat-item-new {
        text-align: center;
        flex: 1;
    }
    
    .stat-item-new:not(:last-child) {
        padding-right: 12px;
        margin-right: 12px;
        margin-left: 0;
        padding-left: 0;
    }
    
    .stat-icon-new {
        color: #3b82f6;
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .stat-number-new {
        font-size: 1rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 2px;
    }
    
    .stat-label-new {
        font-size: 0.77rem; /* زيادة 10% من 0.7rem */
        color: #64748b;
    }
    
    /* Button improvements */
    .start-exam-btn-new {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
        gap: 8px;
    }
    
    /* Compact filters for mobile */
    .filter-title {
        font-size: 1rem;
        margin-bottom: 12px;
        padding: 8px 12px;
        background: linear-gradient(135deg, #f8fafc, #f1f5f9);
        border-radius: 13px;
        border: 1px solid #e2e8f0;
    }

    .filter-title i {
        font-size: 0.9rem;
        animation: filterIconPulse 2s ease-in-out infinite;
    }
    
    .filter-title i {
        font-size: 0.9rem;
    }
    
    /* محاذاة مركزية للهواتف فقط */
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center !important;
        position: relative;
        padding: 3px;
    }

    /* تأثير خلفية للـ filter buttons container على mobile */
    .filter-buttons::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), rgba(226, 232, 240, 0.3));
        border-radius: 12px;
        z-index: -1;
    }
    
    /* Mobile filter buttons - show only specific badges (ONLY on mobile) */
    .filter-buttons .filter-btn:not([data-category="all"]):not([data-category="unsolved"]):not([data-category="add_exam"]):not(.more-btn) {
        display: none;
    }
        /* Mobile spacing: 5% between the main badges */
    .filter-buttons .filter-btn[data-category="all"],
    .filter-buttons .filter-btn[data-category="unsolved"],
    .filter-buttons .filter-btn[data-category="add_exam"],
    .filter-buttons .filter-btn.more-btn {
        margin-left: 0.5%;
        margin-right: 0.5%;
    }
    
    .filter-btn.more-btn {
        display: inline-block !important;
        background: linear-gradient(135deg, #ff6b35, #f7931e);
        color: white;
        border-color: #ff6b35;
    }
    
    .filter-btn.more-btn:hover {
        background: linear-gradient(135deg, #e55a2b, #e8851a);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    .filter-btn.more-btn:not(.has-selected-category):hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(255, 107, 53, 0.25);
    }
    
    .filter-btn.more-btn.has-selected-category {
        background: #10b981 !important;
        color: white !important;
        border-color: #10b981 !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
        position: relative;
        transform: scale(1.05);
        font-weight: 700;
    }

    /* تأثير خاص لـ more button المفعل */
    .filter-btn.more-btn.has-selected-category::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #10b981, #059669, #10b981);
        border-radius: 22px;
        z-index: -1;
        animation: activeGlow 2s ease-in-out infinite alternate;
    }

    .filter-btn.more-btn.has-selected-category::after {
        content: '✓';
        position: absolute;
        top: -6px;
        right: -6px;
        background: #059669;
        color: white;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 1px solid white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
    }
    
    .filter-btn.selected-category {
        background: #10b981 !important;
        color: white !important;
        border-color: #10b981 !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    }
    
    /* Ensure more button is always visible even when selected */
    .filter-btn.more-btn.selected-category {
        display: inline-block !important;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.7125rem; /* تصغير 5% من 0.75rem */
        font-weight: 700;
        border-radius: 20px;
        white-space: nowrap;
        min-width: auto;
        flex: 0 0 auto;
        position: relative;
        transition: all 0.3s ease;
    }

    /* تأثيرات للـ badges غير المفعلة على mobile */
    .filter-btn:not(.active) {
        position: relative;
        transition: all 0.3s ease;
    }

    .filter-btn:not(.active):hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .filter-btn.active {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
        position: relative;
        font-weight: 700;
    }

    /* تأثيرات للـ badges المفعلة على mobile */
    .filter-btn.active::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #3b82f6, #1d4ed8, #3b82f6);
        border-radius: 22px;
        z-index: -1;
        animation: activeGlow 2s ease-in-out infinite alternate;
    }

    .filter-btn.active::after {
        content: '✓';
        position: absolute;
        top: -6px;
        right: -6px;
        background: #10b981;
        color: white;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 1px solid white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }

    /* تأثيرات خاصة للـ badges المختلفة على mobile */
    .filter-btn[data-category="unsolved"].active::before {
        background: linear-gradient(45deg, #8b5cf6, #7c3aed, #8b5cf6);
    }

    .filter-btn[data-category="unsolved"].active::after {
        background: #10b981;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }

    .filter-btn[data-category="add_exam"].active::before {
        background: linear-gradient(45deg, #1e40af, #1e3a8a, #1e40af);
    }

    .filter-btn[data-category="add_exam"].active::after {
        background: #dc2626;
        box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    }

    /* تكبير نصوص معلومات الامتحان على الهواتف */
    .exam-card .exam-card-meta,
    .exam-card-new .exam-card-meta {
        font-size: 17.3px !important; /* زيادة 10% من 15.73px */
    }
    
    /* Mobile More Dropdown */
    .mobile-more-dropdown {
        margin-top: 12px;
        position: relative;
    }
    
    .mobile-dropdown-content {
        background: #ffffff;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .mobile-category-option {
        width: 100%;
        padding: 12px 16px;
        border: none;
        background: #ffffff;
        color: #64748b;
        font-size: 1rem;
        font-weight: 600;
        font-family: 'Cairo', sans-serif;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: right;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: space-between;
        direction: rtl;
    }
    
    .mobile-category-option .category-number {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ff6b35, #f7931e);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        margin-left: 12px;
        flex-shrink: 0;
    }
    
    .mobile-category-option .category-text {
        flex: 1;
        text-align: right;
    }
    
    .mobile-category-option:last-child {
        border-bottom: none;
    }
    
    .mobile-category-option:hover {
        background: #f8fafc;
        color: #475569;
    }
    
    .mobile-category-option:active {
        background: #e2e8f0;
    }
    
    .mobile-category-option.selected-in-dropdown {
        background: #10b981 !important;
        color: white !important;
        border-color: #10b981 !important;
    }
    
    .mobile-category-option.selected-in-dropdown .category-number {
        background: linear-gradient(135deg, #059669, #047857) !important;
        color: white !important;
    }
    
    /* General responsive */
    .exam-system-container:not(:has(.login-container)) {
        padding: 0;
    }
    
    .exam-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-navigation {
        flex-direction: column;
    }
    
    .exam-navigation .exam-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .exam-results-actions {
        flex-direction: column;
    }
    
    .exam-modal-actions {
        flex-direction: column;
    }
    
    .exam-progress {
        flex-direction: column;
        gap: 15px;
    }
    
    .exam-progress-bar {
        margin: 0;
    }
    
    .exam-header-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .exam-header-bar h2 {
        font-size: 20px;
    }
    
    .exam-question-text {
        font-size: 18px;
        line-height: 1.5;
    }
    
    .exam-option label {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .exam-title {
        font-size: 24px;
    }
    
    .exam-description {
        font-size: 16px;
    }
    
    /* Desktop - show all filter buttons */
    @media (min-width: 769px) {
        /* Show all filter buttons on desktop/tablet except more button */
        .filter-buttons .filter-btn:not(.more-btn) {
            display: inline-block !important;
        }
        
        /* Reset margins for desktop/tablet */
        .filter-buttons .filter-btn[data-category="all"],
        .filter-buttons .filter-btn[data-category="unsolved"],
        .filter-buttons .filter-btn[data-category="add_exam"],
        .filter-buttons .filter-btn.more-btn {
            margin-left: 0;
            margin-right: 0;
        }
        
            .filter-btn.more-btn {
        display: none !important;
    }

    /* تأثيرات للـ desktop version للـ badges المفعلة */
    .filter-btn.active {
        position: relative;
        font-weight: 700;
    }

    .filter-btn.active::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #3b82f6, #1d4ed8, #3b82f6);
        border-radius: 27px;
        z-index: -1;
        animation: activeGlow 2s ease-in-out infinite alternate;
    }

    .filter-btn.active::after {
        content: '✓';
        position: absolute;
        top: -8px;
        right: -8px;
        background: #10b981;
        color: white;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }

    /* تأثيرات خاصة للـ badges المختلفة على desktop */
    .filter-btn[data-category="unsolved"].active::before {
        background: linear-gradient(45deg, #8b5cf6, #7c3aed, #8b5cf6);
    }

    .filter-btn[data-category="unsolved"].active::after {
        background: #10b981;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }

    .filter-btn[data-category="add_exam"].active::before {
        background: linear-gradient(45deg, #1e40af, #1e3a8a, #1e40af);
    }

    .filter-btn[data-category="add_exam"].active::after {
        background: #dc2626;
        box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    }

    /* تأثيرات hover للـ desktop */
    .filter-btn[data-category="unsolved"]:not(.active):hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(139, 92, 246, 0.25);
    }

    .filter-btn[data-category="add_exam"]:not(.active):hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(30, 64, 175, 0.25);
    }

    /* إضافة علامة plus لـ badge "إضافة امتحان" بشكل دائم على desktop */
    .filter-btn[data-category="add_exam"]::after {
        content: '+';
        position: absolute;
        top: -14px;
        left: 50%;
        transform: translateX(-50%);
        background: #1e40af;
        color: white;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 1px solid white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
        z-index: 10;
        line-height: 1;
        text-align: center;
    }
        
        .mobile-more-dropdown {
            display: none !important;
        }
    }


/* Disabled button styles */
.exam-btn:disabled,
.exam-btn.disabled {
    background: #94a3b8 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.exam-btn.enabled {
    opacity: 1;
    cursor: pointer;
}

/* Color picker styles */
#exam-badge-color {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
}

.color-preview {
    margin-top: 10px;
}

.color-preview span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    transition: background-color 0.3s ease;
}

/* Add Exam Popup Styles */
.exam-add-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.15s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-add-popup {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: popupSlideIn 0.25s ease-out;
}

.add-popup-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    border-radius: 20px 20px 0 0;
}

.add-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.add-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.add-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.add-popup-content {
    padding: 30px;
}

.add-popup-description {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 0.95rem; /* زيادة 7% من 0.95rem */
    line-height: 1.6;
}

.add-form-group {
    margin-bottom: 25px;
}

.add-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
}

.add-form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    min-height: 120px;
}

.add-form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.add-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.add-btn-primary, .add-btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
}

.add-btn-primary {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
}

.add-btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e293b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.add-btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.add-btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Warning Popup Styles */
.exam-warning-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-warning-popup {
    position: relative;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.3);
    text-align: center;
    min-width: 350px;
    max-width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: popupSlideIn 0.5s ease-out;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.exam-warning-popup .popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.exam-warning-popup .popup-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.exam-warning-popup .popup-message {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.4;
}

.exam-warning-popup .popup-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.exam-warning-popup .popup-progress-bar {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    animation: progressBar 2s linear;
}

.exam-warning-popup.slide-out {
    animation: popupSlideOut 0.3s ease-in;
}

/* Responsive Warning Popup */
@media (max-width: 480px) {
    .exam-warning-popup {
        min-width: 300px;
        max-width: 85%;
        padding: 25px 30px;
        margin: 20px;
    }

    .exam-warning-popup .popup-icon {
        font-size: 40px;
    }

    .exam-warning-popup .popup-title {
        font-size: 1.15rem;
    }

    .exam-warning-popup .popup-message {
        font-size: 1rem;
    }
}

/* Enhanced Admin Styles */
.exam-admin-wrap {
    background: #f1f1f1;
    margin: 20px 0 0 -20px;
    padding: 0;
}

.exam-admin-title {
    background: #fff;
    margin: 0;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-admin-title .dashicons {
    color: #3b82f6;
    font-size: 28px;
}

.results-count {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: normal;
}

/* Statistics Cards */
.exam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f1f1f1;
}

.exam-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease;
}

.exam-stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.stat-icon .dashicons {
    color: white;
    font-size: 24px;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #1e293b;
}

.stat-content p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

/* Charts Section */
.exam-charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 0 30px 30px;
}

.exam-chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.exam-chart-container h3 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
}

/* Popular Exams List */
.popular-exams-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-exam-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-right: 4px solid #3b82f6;
}

.exam-rank {
    width: 30px;
    height: 30px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.exam-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
}

.exam-attempts {
    color: #64748b;
    font-size: 14px;
}

/* Settings Cards */
.exam-settings-container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.exam-settings-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.settings-card-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.settings-card-header h2 {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-size: 20px;
}

.settings-card-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.exam-settings-form {
    padding: 30px;
}

.setting-item {
    margin-bottom: 25px;
}

.setting-toggle {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.setting-info h4 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 16px;
}

.setting-info p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.setting-actions {
    border-top: 1px solid #e2e8f0;
    padding-top: 25px;
    margin-top: 25px;
}

/* Results Table */
.exam-results-toolbar {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input[type="search"] {
    min-width: 300px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-results-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #64748b;
    font-size: 14px;
}

.clear-search {
    color: #3b82f6;
    text-decoration: none;
}

.exam-results-table-container {
    background: #fff;
    overflow-x: auto;
}

.exam-results-table {
    margin: 0;
}

.exam-results-table th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 15px 20px;
    font-weight: 600;
    color: #1e293b;
}

.exam-results-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    color: #1e293b;
    font-size: 14px;
}

.user-email {
    color: #64748b;
    font-size: 13px;
}

.score-numbers {
    font-weight: 600;
    color: #1e293b;
}

.percentage-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.percentage-badge.excellent { background: #10b981; }
.percentage-badge.very-good { background: #3b82f6; }
.percentage-badge.good { background: #f59e0b; }
.percentage-badge.fair { background: #ef4444; }
.percentage-badge.poor { background: #6b7280; }

.date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-date {
    color: #1e293b;
    font-size: 14px;
}

.result-time {
    color: #64748b;
    font-size: 12px;
}

.actions-info {
    display: flex;
    gap: 8px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
}

.no-results p {
    margin: 0;
    font-size: 14px;
}

/* Pagination */
.exam-pagination {
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.exam-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3b82f6;
}

.exam-pagination .page-numbers.current {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.exam-pagination .page-numbers:hover {
    background: #f8fafc;
}

/* Professional Question Display Design */
.exam-system-container.professional-mode {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f9faf8;
    color: #334155;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    max-width: none;
    direction: ltr;
}

/* Assessment Portal Container */
.assessment-portal {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header Card */
.header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
}

.exam-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.exam-info h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.exam-info p {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 400;
}

.exam-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.stat-item {
    background: #d1fae5;
    border: 1px solid #10b981;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    color: #065f46;
}

.timer-stat {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Progress Card */
.progress-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

.progress-value {
    font-size: 0.65rem;
    color: #3b82f6;
    font-weight: 600;
}

.progress-track {
    height: 6px;
    background: #e0e7ff;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    position: relative;
    transition: width 0.3s ease;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: slide 2s infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Question Card */
.question-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.question-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.question-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
}

/* دعم line breaks و paragraph breaks في عرض الأسئلة */
.question-content {
    font-size: 0.9rem !important;
    padding: 20px !important;
    margin: 0 !important;
}

.question-content br {
    margin: 0.3em 0 !important;
}

.question-content p {
    margin: 0.3em 0 !important;
}

.question-content p + p {
    margin-top: 0.3em !important;
}

/* Fix for extra space below question text */
.question-content p:last-child {
    margin-bottom: 0;
}

.question-content strong {
    color: #1e293b;
    font-weight: 600;
}

/* Options Card */
.options-card {
    background: #f9fafb;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.options-title {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-title::before {
    content: none;
    color: #3b82f6;
    font-size: 0.8rem;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.professional-option {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    line-height: 1.5;
    color: #334155;
    position: relative;
    padding-left: 40px;
    text-align: left;
    direction: ltr;
}

.professional-option::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border: 1.5px solid #94a3b8;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

.professional-option:hover {
    background: #e0e7ff;
    border-color: #3b82f6;
    transform: translateX(4px);
}

.professional-option:hover::before {
    border-color: #3b82f6;
}

.professional-option.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
    transform: translateX(4px);
}

.professional-option.selected::before {
    border-color: #3b82f6;
    background: #3b82f6;
    box-shadow: inset 0 0 0 2px white;
}

/* Action Card */
.action-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 0;
    min-height: 84px; /* ضمان ارتفاع ثابت (44px للزر + 40px للـ padding) */
    display: flex;
    align-items: center;
}

.professional-submit-button {
    flex: 1;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.784rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* منع التمدد الزائد */
    flex-shrink: 0; /* منع الانكماش */
    position: relative; /* مطلوب للـ ::before pseudo-element */
    overflow: hidden; /* مطلوب للـ ::before pseudo-element */
}

.professional-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.professional-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.professional-submit-button:hover::before {
    left: 100%;
}

.professional-submit-button:disabled {
    background: rgba(107, 114, 128, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Navigation Buttons */
.professional-navigation {
    display: flex;
    gap: 12px;
    margin-top: 0;
    align-items: center;
    min-height: 44px; /* ضمان ارتفاع ثابت */
    width: 100%; /* ضمان العرض الكامل */
}

/* إزالة المساحة الفارغة عندما يكون هناك زر واحد فقط */
.professional-navigation:has(> button:only-child) {
    justify-content: center;
}

.professional-nav-btn {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.784rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* منع التمدد الزائد */
    flex-shrink: 0; /* منع الانكماش */
}



/* تصحيح حجم التوقيت وتناسقه مع badge السؤال */
.exam-timer-container {
    font-size: 1rem !important;
    padding: 6px 12px !important;
    border-radius: 12px !important;
    height: 28px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.exam-points-badge {
    font-size: 0.679rem !important; /* تصغير 1.5% من 0.689rem */
    padding: 6px 12px !important;
    border-radius: 12px !important;
    height: 28px !important;
    line-height: 1.2 !important;
}

.stat-item {
    font-size: 0.65rem !important;
    padding: 6px 12px !important;
    border-radius: 12px !important;
    height: 28px !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* تكبير خط السؤال والخيارات */
.question-title {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1e293b !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.question-content {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
}

.question-content br {
    margin-top: 0.3em !important; /* تقليل المسافة */
}

.question-content p {
    margin: 0.3em 0 !important;
}

.question-content p + p {
    margin-top: 0.3em !important;
}

.professional-option {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    padding: 16px 20px !important;
    padding-left: 50px !important;
    display: flex !important;
    align-items: center !important;
}

/* تحسين دائرة radio */
.professional-option::before {
    width: 17.8px !important;
    height: 17.8px !important;
    border: 2px solid #94a3b8 !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    position: absolute !important;
}

.professional-option.selected::before {
    border: 2px solid #3b82f6 !important;
    background: #3b82f6 !important;
    box-shadow: inset 0 0 0 3px white !important;
}

/* تحسين موضع النص داخل الخيار */
.professional-option {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    padding: 16px 20px !important;
    padding-left: 50px !important;
    display: flex !important;
    align-items: flex-start !important;
    position: relative !important;
}

/* إضافة wrapper للنص لضمان المحاذاة الصحيحة */
.professional-option-text {
    flex: 1 !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

/* توازن header السؤال */
.question-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
}

.question-number {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* للشاشات الكبيرة */
@media (min-width: 1024px) {
    .question-title {
        font-size: 1.3rem !important;
    }

    .question-content {
        font-size: 0.9rem !important;
    }

    .professional-option {
        font-size: 0.9rem !important;
        padding: 18px 22px !important;
        padding-left: 55px !important;
    }

    .professional-option::before {
        width: 18px !important;
        height: 18px !important;
        left: 20px !important;
    }
}

/* CSS للـ popup المكتمل */
.assessment-completed-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assessment-completed-popup {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.assessment-completed-popup h2 {
    color: #10b981;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.assessment-completed-popup p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .exam-charts-section {
        grid-template-columns: 1fr;
    }
    
    .exam-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input[type="search"] {
        min-width: 100%;
    }
}


/* Responsive Design for Login */
@media (max-width: 768px) {
    .exam-system-container {
        padding: 18px; /* تقليل من 20px إلى 18px (تقليل 10%) */
        min-height: 90vh; /* تقليل من 92vh إلى 90vh (تقليل 10%) */
    }
    
    .header-section {
        padding: 40px 30px;
    }
    
    .form-section {
        padding: 30px 25px;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }

    .logo {
        width: 110px;
    }

    .logo-glow {
        width: 220px;
        height: 130px;
    }
    
    .exam-stats-new::before {
        height: 50%;
    }
    
    .exam-stats-new::after {
        height: 50%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .exam-system-container {
        padding: 15px 13px 30px 13px;
		margin-top: -5px;
        min-height: 93vh;
    }
    
    .exam-header-new {
        padding: 8px 12px;
    }ac
    
    .header-content {
        height: 40px;
        flex-direction: row;
        gap: 10px;
    }
    
    .welcome-section h1 {
        font-size: 1.045rem; /* تقليل 5% من 1.1rem */
    }
    
    .welcome-section p {
        font-size: 0.75rem;
        margin: 0 0 0.03rem 0; /* إضافة 4% margin من الأسفل */
    }
    
    .logout-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        height: 28px;
        gap: 4px;
    }
    
    .header-section {
        padding: 35px 25px;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .main-title {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .form-input {
        padding: 14px 18px;
    }

    .submit-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .logo {
        width: 100px;
    }

    .logo-glow {
        width: 200px;
        height: 120px;
    }
    
    .exam-card-new {
        margin: 0 5px 15px 5px;
    }
    
    .exam-content-new {
        padding: 16px 14px;
    }
    
    .exam-title-new {
        font-size: 1rem;
    }
    
    .exam-description-new {
        font-size: 0.8rem;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.70rem; /* تصغير 5% من 0.75rem */
    }
    
    .filters-section {
        padding: 12px;
    }
    
    .main-content-new {
        padding: 15px 10px;
    }
    
    .stat-number-new {
        font-size: 0.9rem;
    }
    
    .stat-label-new {
        font-size: 0.715rem; /* زيادة 10% من 0.65rem */
    }
    
    .exam-question-text {
        font-size: 16px;
    }
    
    .exam-option label {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .exam-title {
        font-size: 20px;
    }
    
    .exam-description {
        font-size: 14px;
    }
}

/* Extra extra small screens (very small phones) */
@media (max-width: 360px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }

    .info-text {
        font-size: 0.9rem;
    }
    
    .header-section {
        padding: 30px 20px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .logo {
        width: 90px;
    }
    
    .logo-glow {
        width: 180px;
        height: 110px;
    }
}

/* Responsive popup */
@media (max-width: 480px) {
    .exam-success-popup {
        min-width: 300px;
        max-width: 85%;
        padding: 25px 30px;
        margin: 20px;
    }
    
    .exam-success-popup .popup-icon {
        font-size: 40px;
    }
    
    .exam-success-popup .popup-title {
        font-size: 1.3rem;
    }
    
    .exam-success-popup .popup-message {
        font-size: 1rem;
    }
}

.name-popup .name-input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px; /* تقليل المسافة من الأسفل */
}

.name-popup .name-input {
    padding-right: 48px; /* مساحة للأيقونة */
    border: none;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(59,130,246,0.10), 0 1.5px 0 #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 1.08rem;
    font-family: 'Cairo', sans-serif;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    outline: none;
    border: 2px solid #e2e8f0;
}

.name-popup .name-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.13);
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
}

.name-popup .name-input::placeholder {
    color: #b6c3d1;
    font-weight: 400;
    opacity: 0.85;
}

.name-validation-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
    font-family: 'Cairo', sans-serif;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    position: relative;
    z-index: 1;
}

.name-validation-message.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 50px;
    margin: 8px 0;
    padding: 8px 12px;
    border: 1px solid #f59e0b;
}

.confirm-name-btn {
    margin-top: 15px; /* مسافة أكبر من التنويه */
    position: relative;
    z-index: 2;
}

.name-popup .name-input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0.85;
    height: 1em;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* إزالة أي تأثير مزدوج للحدود */
.name-popup .name-input,
.name-popup .name-input:focus,
.name-popup .name-input:active {
    box-shadow: 0 2px 12px rgba(59,130,246,0.10);
}



/* دعم line breaks في صفحة التصحيحات */
.corrections-question-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    direction: ltr !important;
    text-align: left !important;
}

.corrections-question-text br {
    display: block;
    content: "";
    margin-top: 0.3em; /* تقليل من 0.5em إلى 0.3em */
}

.corrections-question-text p {
    margin: 0.3em 0;
}

.corrections-question-text p + p {
    margin-top: 0.3em;
}

/* تحسينات إضافية لصفحة التصحيحات */
.corrections-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
}

.corrections-quiz-container {
    min-height: 100vh !important;
    padding: 0 !important;
}

.corrections-header {
    width: 100% !important;
    margin-bottom: 0 !important;
}

.corrections-option {
    direction: ltr !important;
    text-align: left !important;
}

.corrections-option-icon {
    margin-right: 16px !important;
    margin-left: 0 !important;
}

.corrections-user-choice-badge {
    margin-left: 12px !important;
    margin-right: 0 !important;
}

.corrections-explanation-text {
    direction: ltr !important;
    text-align: left !important;
}

.corrections-explanation-title i {
    margin-right: 8px !important;
    margin-left: 0 !important;
}

#report-question-btn:hover { transform: translateY(-1px) scale(1.03); }

/* Hide Report text on mobile devices */
@media (max-width: 768px) {
    #report-question-btn .report-text {
        display: none !important;
    }
    #report-question-btn {
        width: 33px !important;
        min-width: 33px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
}

/* Show only Q number on mobile devices */
@media (max-width: 768px) {
    #report-question-btn {
        width: auto !important;
        min-width: auto !important;
        padding: 6px 10px !important;
        border-radius: 20px !important;
    }
    #report-question-btn .report-text {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13.5px !important;
    }
    #report-question-btn .report-text .report-word {
        display: none !important;
    }
    #report-question-btn .report-text::before {
        content: "Q" !important;
        color: #5b21b6 !important;
        font-weight: 600 !important;
    }
    #report-question-btn .report-text #current-question-number {
        display: inline !important;
        color: #5b21b6 !important;
        font-weight: 600 !important;
    }
}

/* For very small mobile screens - show only flag icon */
@media (max-width: 360px) {
    #report-question-btn {
        width: 33px !important;
        min-width: 33px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    #report-question-btn .report-text {
        display: none !important;
    }
}

/* Increase filter badges font size by 10% on mobile screens */
@media (max-width: 768px) {
    .filter-btn {
        font-size: 0.78rem !important; /* زيادة 10% من 1.0773rem */
    }
}

/* Very small font size for very small mobile screens */
@media (max-width: 360px) {
    .filter-btn {
        font-size: 0.68rem !important;
    }
}

/* Center nav buttons when on last question */
.action-card--center {
    display: block;
}
.action-card--center .professional-navigation {
    margin-top: 16px !important;
    justify-content: flex-start;
}
.action-card--center .professional-nav-btn {
    max-width: none;
}

/* Force Cairo font on all popups */
.exam-success-popup,
.exam-success-popup *,
.exam-error-popup,
.exam-error-popup *,
.exam-warning-popup,
.exam-warning-popup *,
.exam-timeup-popup,
.exam-timeup-popup *,
#report-popup,
#report-popup * {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure FA icons keep their font inside popups despite Cairo override */
.exam-success-popup i[class^="fa"],
.exam-success-popup i[class*=" fa"],
.exam-error-popup i[class^="fa"],
.exam-error-popup i[class*=" fa"],
.exam-warning-popup i[class^="fa"],
.exam-warning-popup i[class*=" fa"],
.exam-timeup-popup i[class^="fa"],
.exam-timeup-popup i[class*=" fa"],
#report-popup i[class^="fa"],
#report-popup i[class*=" fa"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
}


/* تحسين مسافات أزرار التحقق في صفحة التصحيحات */
.correction-navigation,
.corrections-navigation-section {
    margin-bottom: 25px !important;
    padding-bottom: 15px !important;
    position: relative !important;
    z-index: 10 !important;
}

/* ضمان ظهور الأزرار في نهاية الصفحة */
.correction-navigation::after,
.corrections-navigation-section::after {
    content: '';
    display: block;
    height: 20px;
    width: 100%;
}

/* تحسين المسافات في صفحة التصحيحات */
.corrections-container {
    padding-bottom: 30px !important;
}

/* تحسين المسافات في صفحة النتائج */
.exam-results {
    padding-bottom: 30px !important;
}

/* تكبير أزرار التحقق بنسبة 15% */
.exam-btn {
    padding: 14px 35px !important; /* زيادة 15% من 12px 30px */
    font-size: 18px !important; /* زيادة 15% من 16px */
    border-radius: 9px !important; /* زيادة 15% من 8px */
}

.corrections-nav-button {
    padding: 14px 32px !important; /* زيادة 15% من 16px 32px */
    font-size: 1rem !important; /* زيادة 15% من 1.1rem */
    min-width: 173px !important; /* زيادة 15% من 150px */
    gap: 14px !important; /* زيادة 15% من 12px */
}

.professional-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .assessment-portal {
        padding: 0 12px;
    }

    .header-card,
    .question-card,
    .options-card,
    .action-card {
        padding: 16px 18px;
    }
    
    .action-card {
        min-height: auto; /* إزالة الارتفاع الثابت في الهاتف */
        align-items: stretch; /* تغيير المحاذاة في الهاتف */
    }

    .exam-meta {
        flex-direction: column;
        gap: 8px;
    }

    .exam-info h1 {
        font-size: 1rem;
    }

    .exam-info p {
        font-size: 0.65rem;
    }

    .question-content {
        padding: 14px 16px;
        font-size: 0.65rem;
    }

    .question-content br {
        margin-top: 0.3em; /* تقليل المسافة */
    }

    .question-content p {
        margin: 0.3em 0 !important;
    }

    .question-content p + p {
        margin-top: 0.3em !important;
    }

    .professional-option {
        padding: 12px 14px;
        padding-left: 36px;
        font-size: 0.65rem;
    }

    .professional-navigation {
        flex-direction: column;
        gap: 9px;
        min-height: auto; /* إزالة الارتفاع الثابت في الهاتف */
    }
    
    .professional-nav-btn,
    .professional-submit-button {
        width: 100%;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.784rem;
    }
    

    /* تكبير خط زر Finish Exam على الهاتف - تحديد أكثر */
    .professional-nav-btn#finish-exam {
        font-size: 0.98rem !important;
    }
    
    /* تكبير نصوص معلومات الامتحان على الهواتف */
    .exam-card .exam-card-meta,
    .exam-card-new .exam-card-meta {
        font-size: 17.3px !important; /* زيادة 10% من 15.73px */
    }
}

/* محاذاة عادية للكمبيوتر والتابلت */
@media (min-width: 769px) {
    .filter-buttons {
        justify-content: flex-start !important;
    }
}

/* إضافة علامة plus لـ badge "إضافة امتحان" بشكل دائم على mobile */
@media (max-width: 768px) {
    .filter-btn[data-category="add_exam"]::after {
        content: '+';
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: #1e40af;
        color: white;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 1px solid white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
        z-index: 10;
        line-height: 1;
        text-align: center;
    }

    /* ترتيب badge "اقتراح امتحان" بعد badge "عرض الفئات" على الهاتف */
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-btn[data-category="all"] {
        order: 1;
    }

    .filter-btn[data-category="unsolved"] {
        order: 2;
    }

    .filter-btn[data-category="add_exam"] {
        order: 4; /* بعد badge "عرض الفئات" */
    }

    /* ترتيب باقي الفئات */
    .filter-btn:not([data-category="all"]):not([data-category="unsolved"]):not([data-category="add_exam"]) {
        order: 3;
    }
}

/* Email domain validation styles */
.email-input:invalid:not(:placeholder-shown) + .input-icon {
    color: #ef4444 !important;
}

.email-input.valid-domain {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

.email-input.valid-domain + .input-icon {
    color: #10b981 !important;
}

.email-input.invalid-domain {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.email-input.invalid-domain + .input-icon {
    color: #ef4444 !important;
}

.text-green-500 {
    color: #10b981 !important;
}

.text-red-500 {
    color: #ef4444 !important;
}

/* Domain list styling for warning popup */
.domain-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 7px;
}

.domain-item {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    direction: ltr;
    unicode-bidi: bidi-override;
}

.domain-item:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.domain-item span {
    direction: ltr;
    unicode-bidi: bidi-override;
    display: inline-block;
}

/* بديل للـ :has selector للتوافق مع المتصفحات القديمة */
.professional-navigation.single-button {
    justify-content: center;
}

/* Course Review Popup Styles */
.course-review-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.course-review-popup {
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 90%;
    max-height: 60vh;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: coursePopupSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: row;
}

.course-review-popup-header {
    position: relative;
    border-radius: 25px 0 0 25px;
    overflow: hidden;
    flex: 1;
    min-height: 300px;
    max-width: 50%;
    height: 100%;
}

.course-review-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 25px 0 0 25px;
}

/* Desktop specific image border radius */
@media (min-width: 1025px) {
    .course-review-popup-image {
        border-radius: 25px;
    }
}

.course-review-popup-content {
    padding: 20px 16px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    max-height: 100%;
}

.course-review-popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
}

.course-review-features {
    margin-bottom: 20px;
}

.course-review-feature {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.course-review-feature:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.course-review-feature-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    flex-shrink: 0;
}

.course-review-feature-icon i {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.course-review-feature-text {
    font-size: 0.96rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
    flex: 1;
}

.course-review-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Desktop buttons layout */
@media (min-width: 1025px) {
    .course-review-popup {
        padding-bottom: 20px; /* minimal padding to reduce gap */
    }
    

    .course-review-buttons {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        width: 100%;
        margin-top: 0;
        padding: 6px 12px;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        z-index: 2;
    }
    
    .course-review-btn {
        width: calc(50% - 7.5px);
        margin: 0;
    }
    
    .course-review-popup-content {
        justify-content: flex-start;
        padding-bottom: 0;
    }

    .course-review-features {
        margin-bottom: 5px;
    }
}

.course-review-btn {
    width: 70%;
    margin: 0 auto;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.course-review-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.course-review-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.course-review-btn-primary:hover i,
.course-review-btn-primary:hover {
    color: white;
}

.course-review-btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.course-review-btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

.course-review-btn-secondary:hover i,
.course-review-btn-secondary:hover {
    color: white;
}

/* Animations */
@keyframes coursePopupSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(30px) rotateX(10deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95) translateY(10px) rotateX(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

@keyframes coursePopupSlideOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95) translateY(10px) rotateX(5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.7) translateY(30px) rotateX(10deg);
    }
}

.course-review-popup.slide-out {
    animation: coursePopupSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile and Tablet Responsive */
@media (max-width: 1024px) {
    .course-review-popup {
        width: 95%;
        max-width: 400px;
        margin: 20px;
        flex-direction: column;
        max-height: 80vh;
    }
    
    .course-review-popup-header {
        border-radius: 25px 25px 0 0;
        min-height: 200px;
        max-width: 100%;
        aspect-ratio: auto;
    }
    
    .course-review-popup-image {
        border-radius: 25px 25px 0 0;
    }
    
    .course-review-popup-content {
        padding: 20px 15px 15px 15px;
    }
    
    .course-review-popup-title {
        font-size: 1.1rem;
    }
    
    .course-review-feature {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    
    .course-review-feature-icon {
        width: 28px;
        height: 28px;
        margin-left: 10px;
    }
    
    .course-review-feature-icon i {
        font-size: 0.8rem;
    }
    
    .course-review-feature-text {
        font-size: 0.92rem;
    }
    
    .course-review-btn {
        width: 85%;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .course-review-feature-text {
        font-size: 0.85rem;
    }
}

/* Exam Rating Popup Styles */
.exam-rating-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.exam-rating-popup {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: ratingPopupSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.exam-rating-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.exam-rating-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>');
    opacity: 0.3;
}

.exam-rating-popup-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    position: relative;
    z-index: 1;
}

.exam-rating-popup-icon i {
    font-size: 24px;
    color: white;
}

.exam-rating-popup-title {
    font-size: 1.495rem; /* زيادة 15% من 1.3rem */
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.exam-rating-popup-subtitle {
    font-size: 1.035rem; /* زيادة 15% من 0.9rem */
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.exam-rating-popup-content {
    padding: 25px 20px;
}

.exam-rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
}

.exam-rating-star {
    width: 45px;
    height: 45px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #9ca3af;
}

.exam-rating-star:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #f59e0b;
    transform: scale(1.1);
}

.exam-rating-star.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #f59e0b;
}

/* إزالة القاعدة التي تمنع عمل النجوم */
/* .exam-rating-star.active ~ .exam-rating-star {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
} */

.exam-rating-feedback {
    margin-bottom: 20px;
}

.exam-rating-feedback textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    direction: rtl;
}

.exam-rating-feedback textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.exam-rating-feedback textarea::placeholder {
    color: #9ca3af;
}

.exam-rating-buttons {
    display: flex;
    gap: 12px;
}

.exam-rating-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.exam-rating-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.exam-rating-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.exam-rating-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.exam-rating-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-2px);
}

/* Rating Success Popup */
.exam-rating-success {
    text-align: center;
    padding: 30px 20px;
}

.exam-rating-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.exam-rating-success-icon i {
    font-size: 32px;
    color: white;
}

.exam-rating-success-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 10px;
}

.exam-rating-success-message {
    color: #16a34a;
    font-size: 1.1rem; /* زيادة 15% من 0.9rem */
    margin-bottom: 20px;
    font-weight: 500;
}

/* Animations */
@keyframes ratingPopupSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(30px);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes ratingPopupSlideOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.7) translateY(30px);
    }
}

.exam-rating-popup.slide-out {
    animation: ratingPopupSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .exam-rating-popup {
        width: 95%;
        margin: 20px;
    }
    
    .exam-rating-popup-header {
        padding: 20px 15px;
    }
    
    .exam-rating-popup-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .exam-rating-popup-icon i {
        font-size: 20px;
    }
    
    .exam-rating-popup-title {
        font-size: 1.1rem;
    }
    
    .exam-rating-popup-subtitle {
        font-size: 0.8rem;
    }
    
    .exam-rating-popup-content {
        padding: 20px 15px;
    }
    
    .exam-rating-star {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .exam-rating-buttons {
        flex-direction: column;
    }
    
    .exam-rating-btn {
        width: 100%;
    }
}



/* Mobile - 8% decrease for titles */
@media (max-width: 768px) {
    .exam-rating-popup-title {
        font-size: 1.375rem !important; /* 8% decrease from 1.495rem */
    }
    
    .exam-rating-popup-subtitle {
        font-size: 0.952rem !important; /* 8% decrease from 1.035rem */
    }
}

/* Rating Submit Button - Disabled State (Gray) */
.exam-rating-btn-primary:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    color: #f9fafb !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(156, 163, 175, 0.3) !important;
}

.exam-rating-btn-primary:disabled:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(156, 163, 175, 0.3) !important;
}

/* Rating Submit Button - Enabled State (Blue) */
.exam-rating-btn-primary:not(:disabled) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    cursor: pointer !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.exam-rating-btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
}

/* Floating Bottom Navigation Menu */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(90% * 1.08 * 1.18);
    max-width: calc(320px * 1.08 * 1.18);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: calc(12px * 1.15 * 1.15 * 0.94 * 0.94) calc(16px * 1.15);
    z-index: 1000;
    box-shadow: 0 9.7px 38.8px rgba(0, 0, 0, 0.388), 0 5.82px 19.4px rgba(0, 0, 0, 0.291);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    direction: ltr;
}

.bottom-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: calc(8px * 1.08 * 1.04) calc(16px * 1.08 * 1.04);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: calc(20px * 1.08 * 1.04);
    min-width: auto;
    position: relative;
    gap: calc(6px * 1.08 * 1.04);
}

.bottom-nav-item i {
    font-size: calc(1.1rem * 1.08 * 1.04);
    color: #94a3b8;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item span {
    font-size: calc(0.75rem * 1.08 * 1.04);
    color: #94a3b8;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    white-space: nowrap;
}

.bottom-nav-item.active {
    background: #ffffff;
    padding: calc(8px * 1.08 * 1.08 * 1.04) calc(16px * 1.08 * 1.08 * 1.04);
}

.bottom-nav-item.active i {
    color: #1e293b;
    transform: scale(1.05);
}

.bottom-nav-item.active span {
    color: #1e293b;
    font-weight: 600;
}

.bottom-nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.bottom-nav-item:hover:not(.active) i {
    color: #cbd5e1;
    transform: scale(1.02);
}

.bottom-nav-item:hover:not(.active) span {
    color: #cbd5e1;
}

/* Add bottom padding to main content to account for floating bottom nav */
.main-content-new {
    padding-bottom: 160px;
    min-height: calc(100vh - 160px);
}

/* Ensure profile page has enough space */
.profile-page {
    padding-bottom: 180px;
    min-height: calc(100vh - 180px);
}

/* Add extra space for last elements to prevent overlap with bottom nav */
.profile-actions {
    margin-bottom: 60px !important;
}

/* Ensure all last elements have enough space */
.exam-card:last-child,
.profile-actions {
    margin-bottom: 60px !important;
}

.btn-danger {
    margin-bottom: 20px;
}

/* Ensure exam list has enough space */
.exam-list {
    padding-bottom: 60px;
}

/* Ensure last exam card has space */
.exam-card:last-child {
    margin-bottom: 40px;
}

/* Modern Profile Page Styles */
.profile-page {
    display: none;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
    direction: ltr;
    min-height: calc(100vh - 120px);
}

/* Desktop width increase for profile page */
@media (min-width: 769px) {
    .profile-page {
        max-width: calc(500px * 1.35);
    }
}

.profile-page.active {
    display: block;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 0;
}

.profile-header h2 {
    color: #0f172a;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-header p {
    color: #64748b;
    font-size: 0.95rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
}

.profile-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.profile-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: 24px 24px 0 0;
}

.profile-avatar-section {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px auto;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #93c5fd;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: block;
    align-self: center;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.avatar-overlay i {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Plus badge on avatar */
.avatar-container::after {
    content: '\f067';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #3b82f6;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border: 3px solid #ffffff;
    z-index: 10;
    pointer-events: none;
}



.avatar-container:hover .avatar-overlay {
    opacity: 1;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 4px solid #ffffff;
    margin: 0 auto 16px auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    align-self: center;
}

.avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.avatar-placeholder::before {
    content: '\f067';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    color: #64748b;
    transition: all 0.3s ease;
}

.avatar-placeholder:hover::before {
    color: #475569;
    transform: scale(1.1);
}

.avatar-upload-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.avatar-upload-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.avatar-upload-btn i {
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.025em;
    direction: ltr !important;
    text-align: left !important;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    direction: ltr !important;
    text-align: left !important;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-input:focus {
    outline: none;
    border-color: #d1d5db;
    box-shadow: 0 0 0 4px rgba(209, 213, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-input:disabled {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #6b7280;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.form-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    font-family: 'Cairo', sans-serif;
}

.form-success {
    color: #059669;
    font-size: 0.8rem;
    margin-top: 4px;
    font-family: 'Cairo', sans-serif;
}


/* Action Button Styles */
.action-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: calc(12px * 1.1 * 1.1);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.025em;
    text-decoration: none;
    min-height: 48px;
    opacity: 1 !important;
    transform: translateY(0) !important;
    width: 100%;
    max-width: 100%;
}

.action-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    color: white;
}

.action-btn i {
    font-size: 1rem;
    margin-right: 4px;
}

/* Override btn-primary styles for action buttons */
.action-btn.btn-primary {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
}

/* Specific override for show-corrections button */
#show-corrections.action-btn.btn-primary {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* Exam Results Page Specific Styles */
.actions-section {
    margin-top: 32px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.actions-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

/* Additional Action Button Variants */
.action-btn.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}

.action-btn.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.4);
}

.action-btn.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.action-btn.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

/* Responsive Design for Action Buttons */
@media (max-width: 1024px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .action-btn {
        width: 100%;
        max-width: 400px;
        padding: 14px 20px;
        font-size: 0.9rem;
    }
    
    .actions-section {
        margin-top: 24px;
        padding: 20px 16px;
    }
    
    .actions-title {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .action-btn {
        max-width: 100%;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: calc(12px * 1.1 * 1.1);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.025em;
}

.btn-primary.show {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff !important;
    border: none;
    padding: 16px 32px;
    border-radius: calc(12px * 1.1 * 1.1);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.025em;
    margin-bottom: 40px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.btn-primary:disabled,
.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Desktop Layout - Side by Side (Only for large screens) */
@media (min-width: 1024px) {
    .profile-form {
        display: flex;
        flex-direction: row;
        gap: 40px;
        align-items: flex-start;
        max-width: calc(600px * 1.35);
        margin: 0 auto;
    }
    
    .profile-avatar-section {
        flex: 0 0 auto;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        min-height: 100%;
        align-self: flex-start;
        padding-top: 0;
    }
    
    .profile-form-fields {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }
    
    .form-row {
        flex-direction: row;
        gap: 20px;
    }
    
    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }
    
    
    
    .profile-card {
        max-width: calc(600px * 1.35);
        margin: 0 auto;
    }
}

/* Tablet Layout - Vertical (like mobile) */
@media (min-width: 769px) and (max-width: 1023px) {
    .profile-page {
        max-width: 500px;
    }
    
    .profile-form {
        display: block;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .profile-avatar-section {
        margin-bottom: 32px;
    }
    
    .avatar-container {
        width: calc(100px * 1.2);
        height: calc(100px * 1.2);
    }
    
    .profile-avatar,
    .avatar-placeholder {
        width: calc(100px * 1.2);
        height: calc(100px * 1.2);
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    
}

/* Force border radius and colors for profile elements */
#first-name,
#last-name,
#email {
    border-radius: calc(12px * 1.1 * 1.1) !important;
    border-color: #e5e7eb !important;
}

#first-name:focus,
#last-name:focus,
#email:focus {
    border-color: #d1d5db !important;
    box-shadow: 0 0 0 4px rgba(209, 213, 219, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

#save-profile-btn,
#delete-account-btn {
    border-radius: calc(12px * 1.1 * 1.1) !important;
}

/* Override any conflicting validation styles */
.form-input:valid:not(:focus) {
    border-color: #e5e7eb !important;
}

/* Override any button styles */
button[type="submit"],
button[type="button"] {
    border-radius: calc(12px * 1.1 * 1.1) !important;
}

/* Input Container with Flexbox - Moved to main .input-container rule */

/* Ensure perfect vertical alignment */
.input-container > * {
    vertical-align: middle;
}

.input-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.input-container:focus-within .form-icon {
    background-color: #dbeafe;
    color: #1d4ed8;
    transform: scale(1.05);
}

/* Form Icons - Inside Input Container */
.form-icon {
    color: #6b7280;
    font-size: 14px;
    margin-left: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    top: 0;
    background-color: #f3f4f6;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Hover effect for icons */
.input-container:hover .form-icon {
    background-color: #e5e7eb;
    color: #374151;
}

/* Specific styling for different icon types */
.form-icon.fa-user {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.form-icon.fa-id-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.form-icon.fa-envelope {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* Focus states for different icons */
.input-container:focus-within .form-icon.fa-user {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}

.input-container:focus-within .form-icon.fa-id-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.input-container:focus-within .form-icon.fa-envelope {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* Ensure icon and text are perfectly aligned */
.input-container .form-icon,
.input-container .form-input {
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
}

/* Form Input - Inside Container */
.input-container {
    border: 1.4px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    height: 56px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.input-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-container .form-input {
    border: none;
    outline: none;
    flex: 1;
    padding: 0;
    font-size: 16px;
    background: transparent;
    height: 100%;
    text-align: left;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Remove autofill background */
.input-container .form-input:-webkit-autofill,
.input-container .form-input:-webkit-autofill:hover,
.input-container .form-input:-webkit-autofill:focus,
.input-container .form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: inherit !important;
    background: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-container .form-input:disabled {
    background: transparent;
    color: #6b7280;
    cursor: not-allowed;
}

/* Ensure form groups have proper positioning */
.profile-form-fields .form-group {
    margin-bottom: 16px;
}


.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Enhanced Profile Form Styling */

/* Clean Profile Page Layout */
.profile-page {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.profile-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced Form Row Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Enhanced Avatar Section - Styles moved to main .profile-avatar-section rule */

/* Email notice styling */
.email-notice {
    margin-top: 8px;
    margin-bottom: 16px;
    text-align: left;
}

.email-notice small {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Enhanced Profile Actions */
.profile-actions {
    margin: 20px auto 0 !important;
    padding: 20px !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 500px !important;
    width: 100% !important;
    text-align: center !important;
}

.profile-actions .btn-primary {
    background: #3b82f6 !important;
    border: none !important;
    padding: 14px 32px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    margin: 0 !important;
    width: 100% !important;
}

.profile-actions .btn-primary:hover {
    background: #2563eb !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3) !important;
}

.profile-actions .btn-danger {
    background: #ef4444 !important;
    border: none !important;
    padding: 14px 32px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    margin: 0 !important;
    width: 100% !important;
}

.profile-actions .btn-danger:hover {
    background: #dc2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3) !important;
}

/* Desktop Layout - Computer Screens Only */
@media (min-width: 1024px) {
    /* Make profile form wider on desktop - 35% increase */
    .profile-form {
        max-width: 810px !important;
        width: 100% !important;
    }
    
    /* Make profile actions wider on desktop - 35% increase */
    .profile-actions {
        max-width: 810px !important;
        width: 100% !important;
    }
    
    /* Make profile page container wider on desktop - 35% increase */
    .profile-page {
        max-width: 810px !important;
        width: 100% !important;
    }
    
    /* Arrange buttons side by side on desktop */
    .profile-actions {
        flex-direction: row !important;
        gap: 16px !important;
        justify-content: center !important;
    }
    
    /* Make buttons take equal width when side by side */
    .profile-actions .btn-primary,
    .profile-actions .btn-danger {
        flex: 1 !important;
        width: auto !important;
    }
    
    /* Reduce margin between email field and buttons */
    .profile-actions {
        margin-top: 8px !important;
    }
    
    /* Reduce spacing in profile form fields on desktop */
    .profile-form-fields .form-group {
        margin-bottom: 12px !important;
    }
    
    /* Reduce spacing after email field on desktop */
    .profile-form-fields .form-group:last-of-type {
        margin-bottom: 8px !important;
    }
}

/* Error Messages - Hidden by default */
.form-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
    display: none;
}

/* Very Small Mobile Screens */
@media (max-width: 360px) {
    .bottom-nav {
        width: calc(90% * 1.08 * 1.10 * 0.85 * 1.05) !important;
        max-width: calc(300px * 1.08 * 1.10 * 0.85 * 1.05) !important;
        bottom: 15px;
        padding: calc(12px * 1.15 * 1.15 * 0.94 * 0.94) calc(8px * 1.15);
        border-radius: 25px;
    }
    
    .bottom-nav-item {
        padding: calc(4px * 1.08) calc(8px * 1.08);
        gap: calc(3px * 1.08);
    }
    
    .bottom-nav-item i {
        font-size: calc(0.9rem * 1.08);
    }
    
    .bottom-nav-item span {
        font-size: calc(0.65rem * 1.08);
    }
    
    .bottom-nav-item.active {
        padding: calc(4px * 1.08 * 1.08) calc(8px * 1.08 * 1.08);
    }
    
    .main-content-new {
        padding-bottom: 160px;
    }
    
    .profile-page {
        padding-bottom: 180px;
    }
    
    
    .btn-danger {
        margin-bottom: 30px;
    }
    
    /* Extra spacing for last elements on very small screens */
    .exam-card:last-child {
        margin-bottom: 30px;
    }
    
    .exam-list {
        padding-bottom: 60px;
    }
    
    .profile-form {
        margin-bottom: 20px;
    }
}

/* Mobile Responsive for Profile */
@media (max-width: 768px) {
    .profile-page {
        padding: 12px;
        padding-bottom: 146px;
        min-height: calc(100vh - 146px);
    }
    
    .profile-form {
        padding: 20px;
        border-radius: calc(20px * 1.1);
    }
    
    .form-input {
        border-radius: 25px;
    }
    
    .btn-primary,
    .btn-danger {
        border-radius: calc(12px * 1.1 * 1.1);
    }
    
    .profile-actions {
        margin-bottom: 49px !important;
    }
    
    .exam-card:last-child {
        margin-bottom: 60px !important;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    
    .btn-danger {
        margin-bottom: 20px;
    }
    
    .bottom-nav {
        bottom: 15px;
        width: calc(95% * 1.08 * 1.10);
        max-width: calc(300px * 1.08 * 1.10);
        padding: calc(12px * 1.15 * 1.15 * 0.94 * 0.94) calc(10px * 1.15);
        border-radius: 25px;
    }
    
    .bottom-nav-item {
        padding: calc(6px * 1.08) calc(12px * 1.08);
        gap: calc(4px * 1.08);
    }
    
    .bottom-nav-item i {
        font-size: calc(1rem * 1.08);
    }
    
    .bottom-nav-item span {
        font-size: calc(0.7rem * 1.08);
    }
    
    .bottom-nav-item.active {
        padding: calc(6px * 1.08 * 1.08) calc(12px * 1.08 * 1.08);
    }
    
    .main-content-new {
        padding-bottom: 120px;
    }
    
    .avatar-container {
        width: calc(100px * 1.2);
        height: calc(100px * 1.2);
    }
    
    .profile-avatar,
    .avatar-placeholder {
        width: calc(100px * 1.2);
        height: calc(100px * 1.2);
    }
    
    .avatar-placeholder::before {
        font-size: 1.5rem;
    }
    
    /* Plus badge on mobile */
    .avatar-container::after {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }
}

