/* === Импорт шрифта === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* === CSS Переменные (Темы) === */
:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Дневная тема (Light) */
    --bg-color: #F5F7FA;
    --text-color: #1a1a1a;
    --text-muted: #666666;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);

    /* Монохромные кнопки */
    --btn-bg: rgba(0, 0, 0, 0.05);
    --btn-border: rgba(0, 0, 0, 0.1);

    --blob-1: rgba(173, 216, 230, 0.6);
    --blob-2: rgba(255, 182, 193, 0.4);
    --tag-bg: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Ночная тема (Dark) */
    --bg-color: #000000;
    --text-color: #f0f0f0;
    --text-muted: #a0a0a0;

    --glass-bg: rgba(30, 30, 30, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);

    /* Монохромные кнопки */
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-border: rgba(255, 255, 255, 0.15);

    --blob-1: rgba(0, 80, 255, 0.25);
    --blob-2: rgba(130, 0, 255, 0.15);
    --tag-bg: rgba(255, 255, 255, 0.1);
}

/* === Базовые стили === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Текстура шума (Grain) - 4% opacity по ТЗ */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

/* === Фоновые анимации (Blobs) === */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: float 25s infinite ease-in-out alternate;
}

.blob-1 {
    background: var(--blob-1);
    width: 60vw;
    height: 60vw;
    top: -10%;
    left: -10%;
}

.blob-2 {
    background: var(--blob-2);
    width: 50vw;
    height: 50vw;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10vw, 5vh) scale(1.1);
    }
}

/* === Структура === */
.app-container {
    max-width: 740px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Шапка (Header) === */
header {
    position: sticky;
    top: 20px;
    z-index: 100;
    margin-bottom: 30px;
    padding: 12px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls button {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    box-sizing: border-box;
}

/* === Кнопки (Монохром) === */
button {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    border-radius: 16px;
    /* По ТЗ: 16px для кнопок */
    padding: 8px 16px;
    /* Для остальных кнопок на сайте */
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Инверсия при наведении */
button:hover,
.social-btn:hover {
    transform: translateY(-2px);
    background: var(--text-color);
    color: var(--bg-color);
}

button:active {
    transform: translateY(0);
}

/* === Универсальная стеклянная карточка === */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    /* По ТЗ: 28px для карточек */
    padding: 30px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 25px;
    animation: slideUp 0.6s ease-out;
    /* Без forwards, чтобы не блокировать JS transform */
}

@keyframes slideUp {
    0% {
        opacity: 0;
        top: 20px;
    }

    100% {
        opacity: 1;
        top: 0;
    }
}

/* === 1. Профиль === */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    padding: 4px;
    background: var(--glass-border);
    margin-bottom: 15px;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-bio {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 80%;
}

/* === 2. Соцсети === */
.socials-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.social-btn {
    text-decoration: none;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    border-radius: 16px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    display: inline-block;
}

/* === Заголовки секций === */
.section-header {
    margin-bottom: 15px;
    padding-left: 10px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* === 3. Навыки === */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: var(--tag-bg);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
}

/* === 4 & 5. Опыт и Образование (Списки) === */
.experience-list,
.education-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.list-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 20px 25px;
    box-shadow: var(--glass-shadow);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.item-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.item-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.item-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* === 6. Проекты (Сетка) === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.project-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(128, 128, 128, 0.3);
}

.project-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

/* Скрытие картинки, если её нет */
.project-image[src=""] {
    display: none;
}

.project-info {
    padding: 20px;
}

.project-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Подвал === */
.site-footer {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* === Адаптивность === */
@media (max-width: 600px) {
    .app-container {
        padding: 15px 15px 40px 15px;
    }

    header {
        border-radius: 20px;
        padding: 10px 15px;
    }

    #supportText {
        display: none !important;
    }

    .support-dropdown-container {
        position: static !important;
    }

    .support-btn {
        padding: 0 10px !important;
        height: 36px !important;
        border-radius: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .support-dropdown {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 16px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        z-index: 1000 !important;
        /* Перезаписываем анимации */
        margin-top: 0 !important;
        transform: translateY(-10px) !important;
    }

    .support-dropdown.active {
        transform: translateY(0) !important;
    }

    .glass-card {
        padding: 20px;
        border-radius: 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .item-header {
        flex-direction: column;
        gap: 4px;
    }
}

/* === НОВЫЕ СТИЛИ (добавить в конец style.css) === */



/* SVG Иконки в кнопках соцсетей */
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Расстояние между иконкой и текстом */
}

.social-btn svg {
    transition: transform 0.3s ease;
}

.social-btn:hover svg {
    transform: scale(1.15);
    /* Легкое увеличение иконки при наведении */
}

/* Прогресс-бары для навыков */
.skills-bars-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.skill-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
}

.skill-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--text-color);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* === Кнопка Поддержать и Дропдаун === */
.support-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.support-btn {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid rgba(247, 147, 26, 0.3);
    color: #F7931A;
    gap: 8px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .support-btn {
    background: rgba(247, 147, 26, 0.15);
}

.support-btn:hover {
    background: rgba(247, 147, 26, 0.2);
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.4);
    transform: translateY(-2px);
    color: #F7931A;
    /* Чтобы не инвертировался как обычные кнопки */
}

.support-btn svg,
.support-btn img {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.support-btn:hover svg,
.support-btn:hover img {
    transform: scale(1.15) rotate(10deg);
}

.support-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #ffffff;
    /* Полностью непрозрачный фон для светлой темы */
    border: 1px solid var(--glass-border);
    backdrop-filter: none;
    /* Убираем блюр, чтобы не было артефактов прозрачности */
    -webkit-backdrop-filter: none;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
}

[data-theme="dark"] .support-dropdown {
    background: #1a1a1a;
    /* Полностью непрозрачный фон для темной темы */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.support-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wallet-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: left;
    color: var(--text-color);
    background: transparent;
    border: 1px solid transparent;
    width: 100%;
    transition: background 0.2s, border-color 0.2s;
}

.wallet-item:hover {
    background: var(--btn-bg);
    border-color: var(--glass-border);
}

.wallet-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-item-header svg,
.wallet-item-header img {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.wallet-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.wallet-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.wallet-net {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.wallet-address-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--btn-bg);
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    padding: 6px 10px;
    gap: 8px;
}

.wallet-address {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.copy-wallet-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-wallet-btn:hover {
    background: var(--glass-border);
    color: #F7931A;
}

.copy-wallet-btn:active {
    transform: scale(0.9);
}

/* === Прелоадер === */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-blob {
    width: 60px;
    height: 60px;
    background: var(--glass-border);
    border-radius: 50%;
    animation: pulseLoader 1.5s infinite alternate;
    box-shadow: 0 0 20px rgba(128, 128, 128, 0.2);
}

@keyframes pulseLoader {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

body.loaded .preloader {
    opacity: 0;
    pointer-events: none;
}

/* === Стили для печати (PDF CV) === */
@media print {
    body {
        background: white;
        color: black;
    }

    .bg-blobs,
    header,
    .support-dropdown-container,
    #themeToggle,
    #langToggle {
        display: none !important;
    }

    .app-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        animation: none;
        transform: none !important;
        margin-bottom: 20px;
    }

    .project-card,
    .list-item {
        break-inside: avoid;
        border: 1px solid #eee;
    }

    * {
        transition: none !important;
        animation: none !important;
    }
}