:root {
    --font-primary: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-display: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Global font application - applies to all elements */
*,
*::before,
*::after {
    font-family: var(--font-display);
}

body {
    font-family: var(--font-display);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Ensure form elements use the global font */
input,
textarea,
select,
button {
    font-family: var(--font-display) !important;
}

/* Ensure all text elements inherit font */
p,
span,
div,
a,
li,
td,
th,
label {
    font-family: var(--font-display);
}

.brand-link {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.flag-info-box {
    margin-bottom: 30px;
}

.flag-info-text {
    margin-top: 10px;
    color: #444444;
    font-weight: 600;
}

.student-flag {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.action-buttons-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.flag-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 18px rgba(244, 67, 54, 0.35);
}

.flag-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(244, 67, 54, 0.45);
}

.flag-modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.flag-modal.is-visible {
    display: flex;
}

.flag-dialog {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    width: 95%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Wider dialog for exam-info modal */
#examInfoModal .flag-dialog {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    height: auto;
    overflow: hidden;
    box-sizing: border-box;
}

/* Responsive width for exam-info modal */
@media (max-width: 768px) {
    #examInfoModal .flag-dialog {
        width: 95%;
        max-width: 95%;
        max-height: 85vh;
        height: auto;
    }
}

@media (max-width: 480px) {
    .flag-dialog {
        width: 92%;
        max-width: 92%;
        max-height: 85vh;
        padding: 15px;
        margin: 10px;
    }
    
    #examInfoModal .flag-dialog {
        width: 92%;
        max-width: 92%;
        max-height: 85vh;
        height: auto;
        padding: 0;
        margin: 10px;
    }
    
    .flag-dialog-title {
        padding: 15px 15px 10px 15px;
    }
    
    .flag-actions {
        padding: 10px 15px 15px 15px;
    }
    
    .flag-dialog-close {
        top: 15px;
        left: 15px;
    }
}

.flag-dialog-title {
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 900;
    color: #c62828;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    background: #ffffff;
    z-index: 10;
    padding: 20px 20px 15px 20px;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}

/* Close button in dialog header */
.flag-dialog-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    z-index: 11;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flag-dialog-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.flag-dialog-close:active {
    transform: scale(0.95);
}

.flag-dialog-description {
    margin: 8px 0 16px;
    color: #555555;
    padding: 0 20px;
}

.flag-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 16px 20px;
}

.flag-option {
    display: flex;
    gap: 8px;
    align-items: center;
}

.flag-textarea {
    width: calc(100% - 40px);
    margin: 0 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    font-family: inherit;
    box-sizing: border-box;
}

.flag-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px 20px 20px;
    flex-shrink: 0;
    border-top: 1px solid #e9ecef;
    background: #ffffff;
}

.flag-btn,
.flag-action-btn {
    border: none;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 20px;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flag-btn,
.flag-action-btn.flag-action-submit {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(244, 67, 54, 0.35);
}

.flag-action-btn.flag-action-cancel {
    background: #9e9e9e;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(158, 158, 158, 0.35);
}

.flag-btn:hover,
.flag-action-btn.flag-action-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(244, 67, 54, 0.45);
}

.flag-action-btn.flag-action-cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(158, 158, 158, 0.45);
}

/* Exam Info Button - Light Olive Green */
.exam-info-btn {
    background: linear-gradient(135deg, #50a5ff 0%, #2963bd 100%);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 18px rgba(156, 175, 136, 0.35);
}

.exam-info-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(156, 175, 136, 0.45);
    background: linear-gradient(135deg, #50a5ff 0%, #2963bd 100%);
}

/* Exam Info Modal Styles */
.exam-info-body {
    padding: 20px;
    min-height: 100px;
}

.exam-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #9CAF88;
}

.exam-info-item:last-child {
    margin-bottom: 0;
}

.exam-info-label {
    font-weight: 700;
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.exam-info-value {
    font-size: 1.05rem;
    color: #1e3c72;
    font-weight: 600;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.exam-info-value:empty::before {
    content: '—';
    color: #adb5bd;
    font-weight: 400;
}

.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 700;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideInCenter 0.5s ease-out;
    color: #ffffff;
}

.notification-success {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.notification-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.notification-info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.notification.is-hiding {
    animation: slideOutCenter 0.5s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInCenter {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes slideOutCenter {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
}

/* VPN Warning Popup */
.vpn-warning-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vpn-warning-popup.show {
    opacity: 1;
    pointer-events: all;
}

.vpn-warning-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.vpn-warning-popup.show .vpn-warning-content {
    transform: scale(1);
}

.vpn-warning-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.vpn-warning-message {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.vpn-warning-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.vpn-warning-close:hover {
    background: #f5f5f5;
    color: #333;
}

.vpn-warning-close:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .vpn-warning-content {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .vpn-warning-icon {
        font-size: 36px;
    }
    
    .vpn-warning-message {
        font-size: 14px;
    }
}

/* VPN Warning Banner (Persistent at top of page) */
.vpn-warning-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideDownBanner 0.3s ease-out;
    margin: 0;
    padding: 0;
}

@keyframes slideDownBanner {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.vpn-warning-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    min-height: 56px;
    box-sizing: border-box;
}

.vpn-warning-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.vpn-warning-banner-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
}

.vpn-warning-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.vpn-warning-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.vpn-warning-banner-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Add padding to body when banner is visible to prevent content overlap */
body:has(.vpn-warning-banner) {
    padding-top: 56px;
}

/* Adjust sticky header to appear below the banner - exactly matching banner height */
body:has(.vpn-warning-banner) .header {
    top: 56px;
    margin-top: 0;
}

@media (max-width: 768px) {
    .vpn-warning-banner-content {
        padding: 10px 15px;
        gap: 8px;
        min-height: 48px;
    }
    
    .vpn-warning-banner-icon {
        font-size: 20px;
    }
    
    .vpn-warning-banner-message {
        font-size: 12px;
    }
    
    .vpn-warning-banner-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    body:has(.vpn-warning-banner) {
        padding-top: 48px;
    }
    
    body:has(.vpn-warning-banner) .header {
        top: 48px;
        margin-top: 0;
    }
}
