:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --light-bg: #f3f4f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --disabled-color: #9ca3af;
    --focus-ring-color: rgba(37, 99, 235, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    padding-top: 76px;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #fff 0%, var(--light-bg) 100%);
    padding: 80px 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

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

/* Sections */
section {
    padding: 80px 0;
}

section h2 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* About Section */
#about ul {
    list-style: none;
    padding-left: 0;
}

#about ul li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

#about ul li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Language Switcher */
.dropdown-menu {
    min-width: 200px;
    padding: 0.5rem 0;
    margin: 0;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item .flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.language-btn .flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

/* RTL Support */
[lang="ar"], [lang="ur"] {
    direction: rtl;
    text-align: right;
}

[lang="ar"] .navbar-nav,
[lang="ur"] .navbar-nav {
    padding-right: 0;
}

[lang="ar"] .ms-auto,
[lang="ur"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[lang="ar"] .me-3,
[lang="ur"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

[lang="ar"] .text-md-end,
[lang="ur"] .text-md-end {
    text-align: left !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

/* Form Styles */
.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* Responsive Typography */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    section h2 {
        font-size: 1.75rem;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }
    
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .nav-link {
        padding: 0.5rem 0;
    }
}

/* Responsive Grid for Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Performance Optimized Animations */
.card {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

/* Enhanced Button States */
.btn {
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    background-color: var(--disabled-color) !important;
    border-color: var(--disabled-color) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Enhanced Form States */
.form-control:disabled {
    background-color: var(--light-bg);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--focus-ring-color);
}

/* Accessibility Improvements */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dropdown-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background-color: var(--light-bg);
}

/* High Contrast Text */
.text-contrast-high {
    color: var(--text-color);
    font-weight: 500;
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: calc(50% - 0.5rem);
    right: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
} 