/* 
    ==============================================
    Modern, Accessible, and Performant CSS Stylesheet
    ==============================================
    - Uses CSS variables for easy theming (light/dark).
    - Accessibility-first approach (focus states, reduced motion).
    - Optimized for performance (will-change, efficient selectors).
    - Fully responsive for all screen sizes.
    ==============================================
*/

/* 
    ==============================================
    1. Design Tokens & Theme Variables
    ==============================================
*/

/* General Design Tokens (Theme-agnostic) */
:root {
    --primary-color: #55C1E5; /* Main theme color */
    --secondary-color: #3DA5C7; /* Darker variation */
    --accent-color: #4AB8DB; /* Light accent */
    --accent-color-hover: #2FA8CC; /* Darker accent on hover */
    --bg-gradient: linear-gradient(135deg, #55C1E5 0%, #3DA5C7 100%);

    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-armenian: 'Noto Sans Armenian', 'Inter', sans-serif;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s ease;

    --box-shadow-light: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    --box-shadow-medium: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --box-shadow-heavy: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --border-radius: 12px; /* Softer corners */
    --border-radius-large: 16px;
}

/* Light Theme (Default) */
:root {
    --bg-primary: #55C1E5; /* Clean, bright background */
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a; /* Rich dark text */
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.06);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --alert-bg: #ecfeff;
    --alert-border: #67e8f9;
    --link-color: var(--primary-color);
    --link-hover-color: var(--accent-color);
    --hero-text-color: #ffffff;
    --stat-bg: var(--primary-color);
    --stat-text-color: #ffffff;
    --footer-bg: #1e293b; /* Using updated secondary color */
    --footer-text-color: rgba(255, 255, 255, 0.85);
    --toggler-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2815, 23, 42, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --navbar-bg: rgba(15, 23, 42, 0.85);
    --card-bg: #1e293b;
    --input-bg: #334155;
    --input-border: #334155;
    --alert-bg: #164e63;
    --alert-border: #0891b2;
        --link-color: #55C1E5;
    --link-hover-color: var(--accent-color);
    --hero-text-color: #ffffff;
    --stat-bg: var(--primary-color);
    --stat-text-color: #ffffff;
    --footer-bg: #020617;
    --footer-text-color: rgba(255, 255, 255, 0.8);
    --toggler-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28247, 250, 252, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 
    ==============================================
    2. Base & Reset Styles
    ==============================================
*/
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Smooth transitions for theme switching */
    transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-armenian);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    padding-top: 90px; /* Adjust this value based on navbar height */
}

/* Language-specific font optimization */
[lang="en"] { font-family: var(--font-family-base); }
[lang="ru"] { font-family: 'Inter', 'Arial', sans-serif; }

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Accessibility: Focus Styles */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}
*:focus:not(:focus-visible) {
    outline: none;
}

/* Performance: Animation hints */
.card-modern, .btn, .nav-link, .social-links a {
    will-change: transform, box-shadow;
}

/* 
    ==============================================
    3. Reusable Components
    ==============================================
*/

/* Buttons */
.btn-custom {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    box-shadow: var(--box-shadow-light);
}
.btn-custom:hover {
    background: var(--accent-color-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    color: white;
}

/* Cards */
.card-modern {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    background-color: var(--card-bg);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all var(--transition-normal);
    overflow: hidden;
}
.card-modern:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-color);
}
.card-body {
    padding: 2rem;
    background-color: var(--card-bg);
    color: var(--text-primary);
}
.card-title {
    color: var(--text-primary);
    font-weight: 600;
}
.card-text {
    color: var(--text-secondary);
}
.card-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

/* Forms */
.form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    transition: all var(--transition-fast);
}
.form-control:focus {
    border-color: var(--primary-color);
    background-color: var(--input-bg);
    color: var(--text-primary);
    box-shadow: 0 0 0 4px rgba(85, 193, 229, 0.15);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m6 3v4m0 2h.01'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='%23198754' viewBox='0 0 8 8'%3e%3cpath d='m2.3 4.8 1.5 1.5L6.7 3.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}
.form-label {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Alerts */
.alert {
    background-color: var(--alert-bg);
    border: 1px solid var(--alert-border);
    color: var(--text-primary);
    border-radius: var(--border-radius);
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-medium);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    padding: 0.5rem 0;
}
.dropdown-item {
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    transition: var(--transition-fast);
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--primary-color);
    color: white;
}
.dropdown-item.active {
    background-color: var(--accent-color);
    color: white;
}

/* 
    ==============================================
    4. Layout & Sections
    ==============================================
*/

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow-color);
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color); /* Override bootstrap */
}
.nav-link {
    font-weight: 500;
    color: var(--text-primary); /* Override bootstrap */
    transition: color var(--transition-normal);
    position: relative;
    padding: 0.5rem 1rem;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: all var(--transition-normal);
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}
.navbar-toggler {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}
.navbar-toggler-icon {
    background-image: var(--toggler-icon);
}
.navbar.navbar-scrolled {
    background-color: var(--navbar-bg);
    box-shadow: var(--box-shadow-heavy);
}

/* Hero Section */
.hero-section {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: var(--hero-text-color);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 2rem; /* Ensure content is visible below navbar */
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}
.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    max-width: 600px;
}

/* General Section Styling */
.section {
    padding: 80px 0;
    background-color: var(--bg-primary);
}
.section.bg-secondary {
    background-color: var(--bg-secondary);
}
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Stats Section */
.stats-section {
    background: var(--stat-bg);
    color: var(--stat-text-color);
    padding: 80px 0;
}
.stat-item {
    text-align: center;
    margin-bottom: 2rem;
}
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
}
.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Contact Section */
.contact-form {
    background: var(--card-bg);
    border-radius: var(--border-radius-large);
    padding: 2.5rem;
    box-shadow: var(--box-shadow-heavy);
    border: 1px solid var(--border-color);
}
.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text-color);
    padding: 60px 0 20px;
}
.footer h5 {
    color: white;
    margin-bottom: 1rem;
}
.footer p {
    color: var(--footer-text-color);
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    margin: 0 10px;
    transition: all var(--transition-normal);
    text-decoration: none;
}
.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    color: white;
}

/* 
    ==============================================
    5. Utility & Helper Classes
    ==============================================
*/

/* Theme Toggle Switch */
.theme-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: 1rem;
}
.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition-normal);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
}
.theme-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.theme-toggle input:checked + .theme-slider {
    background-color: var(--primary-color);
}
.theme-toggle input:checked + .theme-slider:before {
    transform: translateX(30px);
}
.theme-icon {
    font-size: 12px;
    color: #666;
    z-index: 1;
}

/* Language Toggle */
.language-toggle {
    background: var(--accent-color) !important;
    color: white !important;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.language-toggle:hover {
    background: var(--accent-color-hover) !important;
    color: white !important;
    transform: translateY(-1px);
}

/* Search Functionality */
.search-container {
    position: relative;
    width: 250px;
}

.search-input {
    padding-right: 40px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    transition: all var(--transition-fast);
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(85, 193, 229, 0.15);
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.search-result-item:hover,
.search-result-item:focus,
.search-result-item.active {
    background: var(--bg-tertiary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-highlight {
    background: rgba(85, 193, 229, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Language dropdown active state */
.language-option.active {
    background-color: var(--primary-color);
    color: white;
}

.language-option.active:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* Diabetes Type Cards */
.diabetes-type-card {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

.diabetes-type-card h6 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.diabetes-type-card p {
    color: var(--text-secondary);
    margin: 0;
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Performance: Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    loading: lazy;
}

.logo-container img {
    loading: eager; /* Hero logo should load immediately */
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--box-shadow-medium);
    transition: all var(--transition-normal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

/* 
    ==============================================
    6. Responsive Styles
    ==============================================
*/

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .hero-title { 
        font-size: 2.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    .section-title { 
        font-size: 2.2rem;
        line-height: 1.3;
    }
    
    /* Enhanced mobile navigation */
    .navbar-collapse {
        margin-top: 1rem;
        background: var(--navbar-bg);
        border-radius: var(--border-radius-large);
        padding: 1rem;
        box-shadow: var(--box-shadow-heavy);
        border: 1px solid var(--border-color);
    }
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: var(--border-radius);
        margin: 0.2rem 0;
        font-size: 1rem;
        text-align: center;
    }
    .navbar-nav .nav-link:hover {
        background-color: var(--primary-color);
        color: white !important;
        transform: translateX(5px);
    }
    .nav-link::after { display: none; }
    
    /* Mobile-friendly language dropdown */
    .language-toggle {
        min-width: 100px;
        justify-content: center;
    }
    
    /* Card adjustments */
    .card-modern {
        margin-bottom: 1.5rem;
    }
    
    /* Form improvements */
    .contact-form {
        padding: 2rem 1.5rem;
    }

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    body { 
        font-size: 1rem;
        line-height: 1.7;
    }
    
    /* Typography improvements */
    .hero-title { 
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    .hero-subtitle { 
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    /* Section spacing */
    .section { 
        padding: 60px 0;
    }
    .section-title { 
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 2rem;
    }
    
    /* Stats section mobile */
    .stats-section { 
        padding: 40px 0;
    }
    .stat-number { 
        font-size: 2rem;
    }
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Navigation mobile */
    .navbar-brand { 
        font-size: 1.5rem;
    }
    .navbar-toggler {
        padding: 0.5rem;
        border: none;
        box-shadow: none;
    }
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(85, 193, 229, 0.25);
    }
    
    /* Form mobile optimization */
    .contact-form { 
        padding: 1.5rem;
        margin: 1rem 0;
    }
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
    }
    .btn-custom {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Footer mobile */
    .footer { 
        padding: 40px 0 20px;
    }
    .footer .col-md-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Diabetes cards mobile */
    .diabetes-type-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography scaling */
    .hero-title { 
        font-size: 1.8rem;
        line-height: 1.2;
    }
    .hero-subtitle { 
        font-size: 0.95rem;
        line-height: 1.4;
    }
    .section-title { 
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }
    
    /* Container adjustments */
    .container { 
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Enhanced button sizing for touch */
    .btn-custom {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Navigation improvements */
    .navbar-brand {
        font-size: 1.3rem;
    }
    .language-toggle {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Form enhancements */
    .form-control {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.75rem;
    }
    textarea.form-control {
        min-height: 120px;
    }
    
    /* Card spacing */
    .card-modern {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* Social and scroll elements */
    .scroll-to-top { 
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
    .social-links a { 
        width: 48px;
        height: 48px;
        margin: 0 8px;
        font-size: 1.1rem;
    }
    
    /* Diabetes info cards */
    .diabetes-type-card {
        padding: 1rem;
        text-align: center;
    }
    .diabetes-type-card h6 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-specific spacing */
    .hero-section {
        padding: 100px 0 80px;
    }
    .section {
        padding: 50px 0;
    }
}

/* Loading and Error States */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card-modern:hover,
    .btn-custom:hover,
    .social-links a:hover,
    .scroll-to-top:hover {
        transform: none;
    }
    .nav-link:hover::after { width: 0; }
    
    /* Enhanced touch targets */
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Touch-friendly buttons */
    .btn, .btn-custom {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Better touch feedback */
    .card-modern:active,
    .btn:active,
    .language-option:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Mobile landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 80px 0 60px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .navbar {
        padding: 0.5rem 0;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Mobile-friendly spacing */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Mobile form improvements */
    .form-floating {
        margin-bottom: 1rem;
    }
    
    /* Better mobile dropdown */
    .dropdown-menu {
        min-width: 200px;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile-optimized text */
    p, .lead {
        line-height: 1.6;
    }
}

/* Mobile navbar scrolled state */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(26, 26, 26, 0.98) !important;
}
