/* ApplyBoard Custom Styles */

/* Enhanced Typography */
:root {
    --primary-font: 'Vazirmatn', 'Inter', 'Poppins', 'Roboto', sans-serif;
    --heading-font: 'Poppins', 'Vazirmatn', sans-serif;
    --body-font: 'Inter', 'Vazirmatn', sans-serif;
    --mono-font: 'Roboto Mono', 'Courier New', monospace;
    
    /* Emerald Green Theme */
    --emerald-primary: #10b981;
    --emerald-dark: #059669;
    --emerald-light: #34d399;
    --emerald-lighter: #6ee7b7;
    --emerald-lightest: #a7f3d0;
    --emerald-bg: #ecfdf5;
    --white-bg: #ffffff;
    --text-emerald: #065f46;
    --text-emerald-light: #047857;
}

/* Global Typography Improvements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide body until i18n is ready to prevent FOUC (Flash of Untranslated Content) */
body:not(.i18n-ready) {
    visibility: hidden;
    opacity: 0;
}

body.i18n-ready {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

body {
    font-family: var(--primary-font);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
    background-color: var(--white-bg);
    color: var(--text-emerald);
}

/* Enhanced Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
    color: var(--text-emerald);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Enhanced Buttons */
.btn {
    font-family: var(--body-font);
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--emerald-primary);
    border-color: var(--emerald-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--emerald-dark);
    border-color: var(--emerald-dark);
    color: white;
}

.btn-outline-primary {
    color: var(--emerald-primary);
    border-color: var(--emerald-primary);
}

.btn-outline-primary:hover {
    background-color: var(--emerald-primary);
    border-color: var(--emerald-primary);
    color: white;
}

.btn-success {
    background-color: var(--emerald-primary);
    border-color: var(--emerald-primary);
    color: white;
}

.btn-success:hover {
    background-color: var(--emerald-dark);
    border-color: var(--emerald-dark);
    color: white;
}

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

/* Enhanced Form Elements */
input, select, textarea {
    font-family: var(--body-font);
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Enhanced Cards */
.card, .university-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--white-bg);
    border: 1px solid var(--emerald-lightest);
    color: var(--text-emerald);
}

/* Budget Indicator Styles */
.budget-indicator {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse-warning 2s infinite;
    position: relative;
    z-index: 10;
}

.budget-indicator i {
    font-size: 0.9rem;
}

.budget-indicator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
    }
}

@keyframes pulse-border {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
}

/* RTL Support for Budget Indicator */
[dir="rtl"] .budget-indicator {
    direction: rtl;
}

[dir="rtl"] .budget-indicator i {
    margin-left: 6px;
    margin-right: 0;
}

.card-header {
    background-color: var(--emerald-bg);
    border-bottom: 1px solid var(--emerald-lightest);
    color: var(--text-emerald);
}

.card-title {
    color: var(--text-emerald);
    font-weight: 600;
}

.card-text {
    color: var(--text-emerald-light);
}

.card:hover, .university-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Enhanced Navigation */
.nav a, .nav-item {
    font-family: var(--body-font);
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    color: var(--text-emerald);
}

.navbar-brand {
    color: var(--emerald-primary) !important;
    font-weight: 700;
}

.nav-link {
    color: var(--text-emerald) !important;
}

.nav-link:hover {
    color: var(--emerald-primary) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white !important;
}

/* Enhanced Tables */
.table th {
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.table td {
    font-family: var(--body-font);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Enhanced Loading States */
.loading {
    font-family: var(--body-font);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Enhanced Error States */
.error {
    font-family: var(--body-font);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        letter-spacing: -0.02em;
    }
    
    h2 {
        font-size: 1.75rem;
        letter-spacing: -0.01em;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
    }
}

/* Enhanced Mobile Responsive Styles */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card, .university-card {
        margin-bottom: 1rem;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e2e8f0;
        --bg-color: #1a202c;
        --card-bg: #2d3748;
    }
    
    body {
        color: var(--text-color);
        background: var(--bg-color);
    }
    
    .card, .university-card {
        background: var(--card-bg);
        color: var(--text-color);
    }
}

/* Print Styles */
@media print {
    * {
        font-family: 'Times New Roman', serif !important;
    }
    
    .btn, .nav, .sidebar {
        display: none !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card, .university-card {
        border: 1px solid #000;
    }
}

/* Mixed Language Text Direction Support */
.mixed-text {
    unicode-bidi: bidi-override;
    direction: ltr;
    text-align: left;
}

.persian-text {
    direction: rtl;
    text-align: right;
}

.english-text {
    direction: ltr;
    text-align: left;
}

/* Auto-detect text direction for mixed content */
.auto-direction {
    unicode-bidi: bidi-override;
}

/* RTL Support for mixed content */
[dir="rtl"] .mixed-text {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] .persian-text {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .english-text {
    direction: ltr;
    text-align: left;
}

/* Smaller buttons for Profile, My Applications, Logout */
#profileLink,
#applicationsLink,
#logoutBtn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.85rem !important;
}