/* ============================================================================
   MAIN.CSS - Основні стилі портфоліо
   
   Зміст:
   1. CSS змінні
   2. Reset стилів
   3. Базові стилі (body, typography)
   4. Header & Navigation
   5. Hero секція
   6. Секції контенту
   7. Картки проектів
   8. Footer
   9. Утиліти
   10. Адаптивність
   ============================================================================ */


/* ============================================================================
   1. CSS ЗМІННІ
   ============================================================================ */

:root {
    /* Кольори - Темна тема (за замовчуванням) */
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-card: #1a2942;
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
    --accent: #64ffda;
    --accent-hover: #52d4b3;
    --border: #233554;
    
    /* Статуси */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Переходи */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Тіні */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 15px 40px rgba(0, 0, 0, 0.3);
    
    /* Розміри */
    --header-height: 80px;
    --container-max-width: 1200px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Z-index шари */
    --z-modal: 2000;
    --z-header: 1000;
    --z-dropdown: 100;
    --z-content: 1;
    --z-background: -1;
}


/* ============================================================================
   2. RESET СТИЛІВ
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

/* Видалення дефолтних стилів списків */
ul, ol {
    list-style: none;
}

/* Видалення дефолтних стилів посилань */
a {
    text-decoration: none;
    color: inherit;
}

/* Кнопки */
button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* Інпути та текстові поля */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Зображення */
img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ============================================================================
   3. БАЗОВІ СТИЛІ
   ============================================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Контейнер */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Типографія */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
}


/* ============================================================================
   4. HEADER & NAVIGATION
   ============================================================================ */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 25, 47, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
    z-index: var(--z-header);
    transition: var(--transition);
}

/* Header для світлої теми (перевизначається в themes.css) */
[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(14, 165, 233, 0.08);
}

nav {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* Логотип */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

/* Навігаційні посилання */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

/* Активне посилання */
.nav-links a.active {
    color: var(--accent);
}

/* Анімація підкреслення при ховері */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Контроли (кнопки теми та мови) */
.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle,
.lang-switch {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-toggle:hover,
.lang-switch:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}


/* ============================================================================
   5. HERO СЕКЦІЯ (Головна сторінка)
   ============================================================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    position: relative;
    z-index: var(--z-content);
    animation: fadeInUp 1s ease-out;
}

.hero-label {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero h1 {
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero h1 .name {
    color: var(--accent);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Кнопки Hero */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.8s both;
}


/* ============================================================================
   6. СЕКЦІЇ КОНТЕНТУ
   ============================================================================ */

main {
    padding-top: var(--header-height);
    min-height: 100vh;
    position: relative;
    z-index: var(--z-content);
}

/* Секція з фоном */
.featured-preview,
.page-section {
    padding: 5rem 2rem;
    background: rgba(17, 34, 64, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: var(--z-content);
}

[data-theme="light"] .featured-preview,
[data-theme="light"] .page-section {
    background: rgba(255, 255, 255, 0.4);
}

/* Заголовки секцій */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

/* Декоративна лінія під заголовком */
.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
}

/* Заголовок сторінки */
.page-header {
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.page-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 1.5rem;
}


/* ============================================================================
   7. КНОПКИ
   ============================================================================ */

.btn {
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ефект пульсації */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* Типи кнопок */
.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(100, 255, 218, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

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

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}


/* ============================================================================
   8. КАРТКИ ПРОЕКТІВ
   ============================================================================ */

/* Сітка проектів */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Картка проекту */
.project-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Анімації для карток (по черзі) */
.project-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out;
}

.project-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.project-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
}

/* Зображення проекту */
.project-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-image-placeholder {
    font-size: 3rem;
    color: var(--text-secondary);
}

/* Статус проекту (завершено/в розробці) */
.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(100, 255, 218, 0.2);
    backdrop-filter: blur(10px);
    color: var(--accent);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Контент картки */
.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Опис на картках проєктів (обмежений) */
.project-card .project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Обмеження в 3 рядки */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Теги технологій */
.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.4rem 0.9rem;
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent);
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

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


/* ============================================================================
   9. ФІЛЬТРИ (Сторінка проектів)
   ============================================================================ */

.filters {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
    border: 1px solid var(--border);
}

[data-theme="light"] .filters {
    background: rgba(255, 255, 255, 0.4);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Поле пошуку */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    flex: 1;
    max-width: 400px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.search-icon {
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Кнопки фільтрів */
.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}


/* ============================================================================
   10. СТОРІНКА "ПРО МЕНЕ"
   ============================================================================ */

/* Секція про мене */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out;
}

.about-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.about-content h1::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.about-text {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

.highlight {
    color: var(--accent);
    font-weight: 600;
}

/* Аватар */
.about-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--bg-card));
    padding: 5px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 5rem;
    color: var(--accent);
}

/* Секція навичок */
.skills-section,
.experience-section,
.goals-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .skills-section,
[data-theme="light"] .experience-section,
[data-theme="light"] .goals-section {
    background: rgba(255, 255, 255, 0.4);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.skill-category li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

/* Timeline (Освіта) */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.44rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    z-index: 1;
}

.timeline-year {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--accent);
    transform: translateX(5px);
}

.timeline-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Секція цілей */
.goals-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out 0.7s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .goals-section {
    background: rgba(255, 255, 255, 0.4);
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.goal-item:hover {
    border-color: var(--accent);
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.goal-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.goal-content {
    flex: 1;
}

.goal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.goal-content strong {
    color: var(--accent);
    font-weight: 600;
}

/* Контакти */
.contact-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.8s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .contact-section {
    background: rgba(255, 255, 255, 0.4);
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    font-weight: 500;
    transition: var(--transition);
}

.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}


/* ============================================================================
   10.5 ICON STYLES
   ============================================================================ */

/* Базовий клас для адаптивних SVG-іконок */
.icon {
    display: inline-block;
    background-color: var(--accent); /* Колір для темної теми за замовчуванням */
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: -0.2em; /* Вирівнювання по тексту */
}

/* Розмір іконок за замовчуванням */
.btn-icon, .link-icon, .contact-icon, .title-icon, .category-icon, .timeline-icon {
    width: 1.2em;
    height: 1.2em;
}

/* Посилання на картках проєктів */
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-link:hover {
    color: var(--accent);
}

/* Специфічні розміри іконок */
.search-icon {
    width: 18px;
    height: 18px;
}

.project-image-placeholder .icon,
.no-results-icon .icon {
    width: 48px;
    height: 48px;
}

.feature-icon .icon {
    width: 24px;
    height: 24px;
}


.modal-close .icon {
    width: 20px;
    height: 20px;
}

.goal-icon .icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
}

/* Loader animation */
.loader-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin-right: 0.5em;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   11. FOOTER
   ============================================================================ */

footer {
    background: rgba(17, 34, 64, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(100, 255, 218, 0.08);
    margin-top: 5rem;
    position: relative;
    z-index: var(--z-content);
}

[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(14, 165, 233, 0.08);
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}


/* ============================================================================
   12. MODAL
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius-sm);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}


/* ============================================================================
   13. УТИЛІТИ
   ============================================================================ */

/* Стани завантаження */
.loading {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Порожні стани */
.no-results,
.no-data,
.no-projects {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
}

.no-results h3,
.no-data h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results a,
.no-data a {
    color: var(--accent);
    text-decoration: underline;
}

/* Сховати елемент */
.hidden {
    display: none !important;
}

/* Показати тільки для скрінрідерів */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================================
   14. АДАПТИВНІСТЬ
   ============================================================================ */

/* ============================================================================
   MOBILE RESPONSIVE FIXES V2 - Виправлення для мобільних пристроїв
   Замініть існуючі @media (max-width: 768px) та @media (max-width: 480px)
   ============================================================================ */

/* Мобільні пристрої */
@media (max-width: 768px) {
    /* ✅ HEADER - УЛЬТРА КОМПАКТНИЙ, горизонтальний */
    header {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: var(--z-header);
    }
    
    nav {
        flex-direction: row; /* ✅ горизонтально! */
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        max-height: 50px; /* ✅ обмеження висоти */
    }
    
    .logo {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .nav-links {
        gap: 0.5rem;
        font-size: 0.85rem;
        margin: 0;
        flex: 1;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .nav-links a {
        padding: 0.25rem 0.5rem;
    }
    
    .controls {
        gap: 0.35rem;
        display: flex;
        align-items: center;
    }
    
    .theme-toggle,
    .lang-switch {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    /* ✅ MAIN - компенсація зменшеного header */
    main {
        padding-top: 50px; /* ✅ тільки 50px замість 100px */
    }
    
    /* ✅ HERO - менший текст, без зайвого margin-top */
    .hero {
        padding: 2rem 1rem 1.5rem 1rem;
        min-height: auto;
        margin-top: 0; /* ✅ прибрали зайвий відступ */
    }
    
    .hero h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .hero p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .hero-label {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.85rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* ✅ ЗАГОЛОВКИ - менші */
    .page-title {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    /* ✅ ПРОЕКТИ */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        border-radius: 10px;
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .project-content {
        padding: 1.2rem;
    }
    
    .project-tags {
        gap: 0.4rem;
    }
    
    .tag {
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
    }
    
    /* ✅ ФІЛЬТРИ - компактніші */
    .filters {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .filter-label {
        font-size: 0.95rem;
    }
    
    .search-box {
        max-width: 100%;
        width: 100%;
        padding: 0.4rem 0.85rem;
    }
    
    .search-box input {
        font-size: 0.9rem;
    }
    
    .filter-buttons {
        width: 100%;
        gap: 0.6rem;
    }
    
    .filter-btn {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }
    
    /* ✅ СЕКЦІЇ - менші відступи */
    .featured-preview,
    .page-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
        padding-top: 0.5rem;
    }
    
    /* ✅ ПРО МЕНЕ - !!!КРИТИЧНО ВИПРАВЛЕНО!!! */
    .about-section {
        display: flex; /* ✅ змінено з grid */
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
        padding: 0;
    }
    
    .about-content {
        order: 2; /* ✅ текст ПІСЛЯ аватарки */
        width: 100%;
    }
    
    .about-avatar {
        order: 1; /* ✅ аватар ПЕРШИМ */
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .about-content h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .about-text {
        font-size: 0.95rem; /* ✅ нормальний розмір! */
        line-height: 1.7; /* ✅ більше простору між рядками */
        max-width: 100%; /* ✅ на всю ширину */
    }
    
    .about-text p {
        margin-bottom: 1rem; /* ✅ відступи між параграфами */
    }
    
    .avatar-container {
        width: 160px;
        height: 160px;
        margin: 0 auto; /* ✅ по центру */
    }
    
    .avatar-placeholder {
        font-size: 2.2rem;
    }
    
    /* ✅ НАВИЧКИ */
    .skills-section,
    .experience-section,
    .goals-section,
    .contact-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-category {
        padding: 1.2rem;
    }
    
    .skill-category h3 {
        font-size: 1.05rem;
        margin-bottom: 0.8rem;
    }
    
    .skill-category li {
        font-size: 0.9rem;
        padding: 0.35rem 0;
        line-height: 1.5;
    }
    
    /* ✅ ОСВІТА */
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .timeline-year {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .timeline-content {
        padding: 1.2rem;
    }
    
    .timeline-content h3 {
        font-size: 1.05rem;
        margin-bottom: 0.6rem;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* ✅ ЦІЛІ */
    .goal-item {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .goal-icon {
        font-size: 1.5rem;
        min-width: 40px;
    }
    
    .goal-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* ✅ КОНТАКТИ */
    .contact-section h2 {
        font-size: 1.4rem;
        margin-bottom: 0.85rem;
    }
    
    .contact-section p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 0.85rem;
    }
    
    .contact-link {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* ✅ FOOTER */
    footer {
        padding: 1.5rem 1rem;
        margin-top: 2.5rem;
    }
    
    footer p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* ✅ ДУЖЕ МАЛЕНЬКІ ЕКРАНИ */
@media (max-width: 480px) {
    nav {
        padding: 0.4rem 0.75rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        font-size: 0.8rem;
        gap: 0.35rem;
    }
    
    .nav-links a {
        padding: 0.2rem 0.4rem;
    }
    
    .theme-toggle,
    .lang-switch {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-height: 28px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 1.5rem 0.75rem 1.25rem 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .featured-preview,
    .page-section {
        padding: 1.5rem 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    .filters {
        padding: 1rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-title {
        font-size: 1.15rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .skills-section,
    .experience-section,
    .goals-section,
    .contact-section {
        padding: 1.5rem 0.75rem;
    }
    
    .skill-category,
    .timeline-content,
    .goal-item {
        padding: 1rem;
    }
    
    .about-text {
        font-size: 0.9rem;
        line-height: 1.65;
    }
    
    .avatar-container {
        width: 140px;
        height: 140px;
    }
    
    footer {
        padding: 1rem 0.75rem;
    }
    
    footer p {
        font-size: 0.8rem;
    }
}

/* Preference для зменшення анімацій */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
