/* Leben in Deutschland - Новые стили согласно ТЗ */

/* Font Optimization - System Fonts with Web Font Fallbacks */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Font System - Optimized for Performance and Accessibility */
    --font-family-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
    
    /* Основные цвета организации */
    --primary-yellow: #FFCC00;      /* Основной желтый - фон header */
    --logo-primary: #0066CC;        /* Синий из логотипа */
    --logo-secondary: #CC3300;      /* Красный из логотипа */
    
    /* Чистые цвета для акцентов */
    --pure-red: #FF0000;            /* Красный */
    --pure-orange: #FF6600;         /* Оранжевый */
    --pure-yellow: #FFCC00;         /* Желтый */
    --pure-green: #00CC00;          /* Зеленый */
    --pure-cyan: #00CCFF;           /* Голубой */
    --pure-blue: #0066FF;           /* Синий */
    --pure-purple: #6600FF;         /* Фиолетовый */
    
    /* Системные цвета */
    --white: #FFFFFF;
    --black: #000000;
    --gray-light: #F5F5F5;
    --gray-medium: #CCCCCC;
    --gray-dark: #333333;
    --text-dark: #212529;
    
    /* Отступы и размеры */
    --container-max-width: 1200px;
    --border-radius: 0.375rem;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    
    /* Переходы */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

/* Global Font Optimization */
* {
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'pnum' 1, 'tnum' 0, 'onum' 1, 'lnum' 0, 'dlig' 0;
}

html {
    font-family: var(--font-family-sans);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family-sans);
    font-weight: 400;
    line-height: 1.6;
}

/* Headings Font Optimization */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-sans);
    font-weight: 600;
    line-height: 1.3;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'dlig' 1;
}

/* Monospace Elements */
code, pre, kbd, samp {
    font-family: var(--font-family-mono);
    font-feature-settings: 'kern' 0, 'liga' 0, 'calt' 0, 'dlig' 0;
}

/* Bootstrap Icons Font Display Optimization */
@font-face {
    font-family: "bootstrap-icons";
    src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/fonts/bootstrap-icons.woff2?24e3eb84d0bcaf83d77f904c78ac1f47") format("woff2"),
         url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/fonts/bootstrap-icons.woff?24e3eb84d0bcaf83d77f904c78ac1f47") format("woff");
    font-display: swap;
}

/* Web Font Loading Performance */
.wf-loading body {
    font-family: system-ui, -apple-system, sans-serif;
}

.wf-inactive body {
    font-family: system-ui, -apple-system, sans-serif;
}

/* Font Loading States */
.font-loaded {
    font-family: var(--font-family-sans);
}

/* Bootstrap переопределения */
.navbar {
    background-color: var(--primary-yellow) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-dark) !important;
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 0.5rem 1rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--logo-primary) !important;
}

/* Navbar toggler optimization */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Кнопки с чистыми цветами */
.btn-primary {
    background-color: var(--logo-primary);
    border-color: var(--logo-primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--pure-blue);
    border-color: var(--pure-blue);
}

.btn-success {
    background-color: var(--pure-green);
    border-color: var(--pure-green);
    color: var(--white);
}

.btn-warning {
    background-color: var(--pure-orange);
    border-color: var(--pure-orange);
    color: var(--white);
}

.btn-danger {
    background-color: var(--pure-red);
    border-color: var(--pure-red);
    color: var(--white);
}

/* Карточки */
.card {
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--gray-light);
    border-bottom: 1px solid var(--gray-medium);
}

/* Секции */
.section-title {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--logo-primary);
    border-radius: 2px;
}

/* Hero секция */
.hero-section {
    background: linear-gradient(135deg, var(--logo-primary), var(--pure-cyan));
    color: var(--white);
    padding: 4rem 0;
}

.hero-title {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Категории событий/проектов */
.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.category-integration { background-color: var(--pure-green); color: var(--white); }
.category-culture { background-color: var(--pure-purple); color: var(--white); }
.category-language { background-color: var(--pure-blue); color: var(--white); }
.category-community { background-color: var(--pure-orange); color: var(--white); }
.category-education { background-color: var(--pure-cyan); color: var(--white); }

/* Статусы событий */
.status-upcoming { border-left: 4px solid var(--pure-green); }
.status-active { border-left: 4px solid var(--pure-orange); }
.status-recurring { border-left: 4px solid var(--pure-blue); }
.status-completed { border-left: 4px solid var(--gray-medium); }

/* Формы */
.form-control:focus {
    border-color: var(--logo-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Footer */
.footer {
    background-color: var(--gray-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-title {
    color: var(--primary-yellow);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: var(--gray-medium);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--primary-yellow);
}

/* GDPR Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--gray-dark);
    color: var(--white);
    padding: 1rem;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-banner.hidden {
    display: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 320px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Navbar optimization for 320px */
    .navbar-brand img {
        height: 35px;
        width: auto;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Card optimization */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .card-text {
        font-size: 0.85rem;
    }
    
    /* Breadcrumb optimization */
    .breadcrumb {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        font-size: 0.7rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    /* Footer optimization */
    .footer-section h5 {
        font-size: 1rem;
    }
    
    .footer-section ul li {
        font-size: 0.85rem;
    }
    
    /* Form elements */
    .form-control {
        font-size: 0.9rem;
    }
    
    /* Event/Project cards specific */
    .event-date {
        font-size: 0.75rem;
    }
    
    .event-time, .event-location {
        font-size: 0.8rem;
    }
}

/* Tablet optimization (768px and below) */
@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Small mobile (576px and below) */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1.25rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    font-size: 2rem;
    color: var(--text-dark);
}

/* Value Items */
.value-item {
    padding: 1.5rem;
    border-left: 3px solid var(--primary-yellow);
    background: var(--white);
    height: 100%;
}

.value-item h5 {
    margin-bottom: 1rem;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-yellow);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary-yellow);
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}

.timeline-content {
    padding-left: 1rem;
}

.timeline-content h5 {
    color: var(--logo-primary);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    margin-bottom: 0;
    color: var(--gray-dark);
}

/* Project Cards */
.project-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: none;
    box-shadow: var(--shadow-sm);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Landing Page Styles */
.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0 auto 1rem auto;
    color: var(--text-dark);
}

.service-item {
    padding: 2rem 1rem;
    text-align: center;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.feature-icon-sm {
    width: 50px;
    height: 50px;
    background: var(--primary-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-dark);
}

/* SEO Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--gray-dark);
}

/* Testimonial Cards */
.testimonial-card {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    height: 100%;
}

/* FAQ Accordion */
.accordion-button:not(.collapsed) {
    background-color: var(--primary-yellow);
    color: var(--text-dark);
    border-color: var(--primary-yellow);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background-color: var(--gray-light);
    padding: 0.75rem 0;
    margin-bottom: 0;
}

.breadcrumb {
    background: transparent;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--gray-dark);
}

.breadcrumb-item a {
    color: var(--logo-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--logo-secondary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--gray-medium);
}

/* Home icon in breadcrumb */
.breadcrumb-item i.bi-house-fill {
    font-size: 1rem;
    vertical-align: baseline;
}

.breadcrumb-item a i.bi-house-fill:hover {
    transform: scale(1.1);
    transition: transform var(--transition-fast);
}

/* Fixed Height Images for About Page */
.about-hero-image {
    height: 400px;
    object-fit: cover;
    width: 100%;
}

.about-section-image {
    height: 300px;
    object-fit: cover;
    width: 100%;
}

/* Responsive adjustments for images */
@media (max-width: 768px) {
    .about-hero-image {
        height: 250px;
    }
    
    .about-section-image {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .about-hero-image {
        height: 200px;
    }
    
    .about-section-image {
        height: 180px;
    }
}

/* ====== PROJEKT DETAIL STYLES ====== */

/* Project Hero Section */
.project-hero {
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--white) 100%);
    border-bottom: 1px solid var(--gray-medium);
}

.project-hero .project-image-container img {
    max-height: 300px;
    width: 100%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}

.project-meta {
    margin-top: 1.5rem;
}

.project-meta .d-flex {
    padding: 1rem;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--logo-primary);
}

/* Project Content Sections */
.project-details {
    background-color: var(--white);
}

.activity-item {
    border-left: 3px solid var(--logo-primary);
    transition: var(--transition-normal);
}

.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-left-color: var(--logo-secondary);
}

.achievement-card {
    transition: var(--transition-normal);
    border-left: 4px solid var(--pure-green) !important;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Sidebar Cards */
.project-sidebar .card {
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.project-sidebar .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-sidebar .card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.project-sidebar .contact-info a {
    color: var(--logo-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.project-sidebar .contact-info a:hover {
    color: var(--logo-secondary);
    text-decoration: underline;
}

/* Target Groups Badges */
.target-groups .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

/* Related Projects Section */
.related-projects {
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--primary-yellow) 100%);
}

/* Error States */
.error-content {
    padding: 3rem 1rem;
}

.error-content i {
    margin-bottom: 1rem;
}

/* Responsive Design für Projekt Details */
@media (max-width: 992px) {
    .project-hero {
        text-align: center;
    }
    
    .project-hero .project-image-container {
        margin-top: 2rem;
    }
    
    .project-sidebar {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .project-hero .project-image-container img {
        max-height: 250px;
    }
    
    .project-meta .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .achievements-grid .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .activity-item {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .project-hero {
        padding: 2rem 0 !important;
    }
    
    .project-hero h1 {
        font-size: 1.75rem;
    }
    
    .project-hero .display-4 {
        font-size: 1.75rem;
    }
    
    .project-details {
        padding: 2rem 0 !important;
    }
}

/* ====== LAZY LOADING IMAGES ====== */

/* Lazy loading image states */
.lazy-loading {
    opacity: 0.6;
    filter: blur(5px);
    transition: filter 300ms ease, opacity 300ms ease;
}

.lazy-loaded {
    opacity: 1;
    filter: none;
}

.lazy-error {
    opacity: 0.8;
    background-color: var(--gray-light);
    border: 1px dashed var(--gray-medium);
}

/* Skeleton loader for images */
.image-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image fade-in animation */
.fade-in {
    animation: fadeIn 300ms ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Native lazy loading support */
img[loading="lazy"] {
    transition: opacity 300ms ease;
}

/* Intersection observer fallback */
.no-intersection-observer img[data-src] {
    opacity: 1;
    filter: none;
}

/* Performance optimizations */
.lazy-loading,
.lazy-loaded,
.lazy-error {
    contain: layout style paint;
    will-change: opacity, filter;
}

/* Mobile optimizations for lazy loading */
@media (max-width: 768px) {
    .lazy-loading {
        filter: blur(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lazy-loading,
    .lazy-loaded {
        transition: none;
        filter: none;
    }
    
    .image-skeleton {
        animation: none;
        background: var(--gray-light);
    }
    
    .fade-in {
        animation: none;
    }
}