/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* هدر اصلی */
.main-header {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: white;
    padding: 20px 0 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 30px;
}

.main-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #ff8a00, #e52e71);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 15px auto;
    padding: 0 20px;
}

.logo-container {
    flex: 0 0 auto;
}

.university-logo {
    height: 170px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    background: white;
    padding: 5px;
    transition: transform 0.3s ease;
}

.university-logo:hover {
    transform: scale(1.05);
}

.university-info {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.university-info h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.university-info h2 {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.95;
}

.header-spacer {
    flex: 0 0 auto;
    width: 80px;
}

.contact-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9rem;
}

.contact-info p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.contact-info i {
    color: #ffd700;
}

/* کانتینر اصلی */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* باکس خوش آمدگویی */
.welcome-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
    border-top: 5px solid #1a2980;
}

.welcome-icon {
    font-size: 4rem;
    color: #1a2980;
    margin-bottom: 20px;
}

.welcome-title {
    color: #1a2980;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.welcome-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.primary-btn {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: white;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #26d0ce, #1a2980);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(38, 208, 206, 0.4);
}

.secondary-btn {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.secondary-btn:hover {
    background: #e0e0e0;
    transform: translateY(-3px);
}

/* ویژگی‌ها */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    border-top: 4px solid #26d0ce;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    color: #1a2980;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* دستورالعمل */
.instructions-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    border-right: 4px solid #ff9800;
}

.instructions-box h3 {
    color: #1a2980;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-list {
    list-style-type: none;
    padding-right: 20px;
}

.instructions-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    color: #555;
    line-height: 1.8;
    position: relative;
    padding-right: 25px;
}

.instructions-list li:before {
    content: "→";
    position: absolute;
    right: 0;
    color: #26d0ce;
    font-weight: bold;
}

.instructions-list li:last-child {
    border-bottom: none;
}

/* آمار */
.stats-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    border-left: 4px solid #4caf50;
}

.stats-box h3 {
    color: #1a2980;
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.stat-item:hover {
    background: #e9ecef;
    transform: translateY(-3px);
}

.stat-item i {
    font-size: 2.5rem;
    color: #1a2980;
    margin-bottom: 15px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #26d0ce;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-item.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

/* فرم‌ها */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #26d0ce;
    box-shadow: 0 0 0 3px rgba(38, 208, 206, 0.2);
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

.submit-btn {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #26d0ce, #1a2980);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(38, 208, 206, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* باکس نتایج */
.result-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
    border-top: 5px solid #4caf50;
}

.result-icon {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: 20px;
}

.result-title {
    color: #1a2980;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.result-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.result-form {
    max-width: 500px;
    margin: 0 auto;
}

.national-input {
    width: 100%;
    padding: 14px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-family: monospace;
    letter-spacing: 1px;
    direction: ltr;
}

.national-input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.result-submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    margin-top: 20px;
}

.result-info-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 2px solid #4caf50;
    animation: slideIn 0.5s ease;
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.result-header h3 {
    color: #1a2980;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-status {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-pass {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-fail {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.result-item {
    flex: 1;
}

.result-item.full-width {
    flex: 2;
}

.result-item label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item span {
    display: block;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
    color: #333;
    font-weight: 500;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.score-highlight {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a2980;
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
}

.pass-message {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.pass-message.pass {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pass-message.fail {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.download-pdf-btn,
.print-btn,
.new-search-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.download-pdf-btn {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
}

.download-pdf-btn:hover {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.4);
}

.print-btn {
    background: #ff9800;
    color: white;
}

.print-btn:hover {
    background: #f57c00;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
}

.new-search-btn {
    background: #2196f3;
    color: white;
}

.new-search-btn:hover {
    background: #1976d2;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.4);
}

.result-notice {
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.result-notice i {
    color: #2196f3;
    font-size: 1.5rem;
    margin-top: 3px;
}

.result-notice p {
    margin: 0;
    color: #0d47a1;
    line-height: 1.6;
}

/* پیام‌های خطا و موفقیت */
.error-message,
.success-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.error-message {
    background: #ffebee;
    border-right: 4px solid #e53935;
    color: #c62828;
}

.success-message {
    background: #e8f5e9;
    border-right: 4px solid #4caf50;
    color: #2e7d32;
}

.error-box {
    background: #ffebee;
    border-right: 4px solid #e53935;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.3s ease;
    display: none;
}

.error-box i {
    font-size: 1.2rem;
}

/* راهنما */
.help-box {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    border-right: 4px solid #666;
}

.help-box h3 {
    color: #444;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    padding: 10px 0 10px 30px;
    border-bottom: 1px dashed #ddd;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.help-list li:before {
    content: "•";
    color: #1a2980;
    font-size: 1.5rem;
    position: absolute;
    right: 0;
    top: 5px;
}

.help-list li:last-child {
    border-bottom: none;
}

/* فوتر */
.main-footer {
    background: #333;
    color: white;
    padding: 25px 0;
    text-align: center;
    position: relative;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 8px 0;
    color: #ccc;
    font-size: 0.9rem;
}

.footer-content a {
    color: #26d0ce;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #1a9c9a;
    text-decoration: underline;
}

/* رسپانسیو */
@media (max-width: 992px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    .header-spacer {
        display: none;
    }

    .university-info h1 {
        font-size: 1.3rem;
    }

    .university-info h2 {
        font-size: 1rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .welcome-box {
        padding: 25px;
    }

    .result-box {
        padding: 25px;
    }

    .result-row {
        flex-direction: column;
        gap: 15px;
    }

    .result-item {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .download-pdf-btn,
    .print-btn,
    .new-search-btn {
        width: 100%;
        justify-content: center;
    }

    .result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .result-notice {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 15px;
    }

    .university-logo {
        height: 60px;
    }

    .university-info h1 {
        font-size: 1.1rem;
    }

    .university-info h2 {
        font-size: 0.9rem;
    }
}

/* صفحه 404 */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 h1 {
    font-size: 4rem;
    color: #e53935;
    margin-bottom: 20px;
}

.error-404 h2 {
    color: #1a2980;
    margin-bottom: 20px;
}

.error-404 p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* لودینگ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #26d0ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}