/* CSS переменные для тем */
:root {
    /* Светлая тема (по умолчанию) */
    --bg-color: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --text-secondary: #666;
    --card-bg: #ffffff75;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --button-bg: #f5f5f5;
    --button-hover: #e5e5e5;
    --button-text: #333;
    --telegram-blue: #0088cc;
    --footer-text: rgba(255, 255, 255, 0.9);
    --overlay-bg: rgba(0, 0, 0, 0.1);
    --overlay-dark-bg: rgba(0, 0, 0, 0.5);
    --border-radius: 16px;
}

/* Темная тема - теперь только через системные настройки */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: rgba(18, 18, 18, 0.85);
        --text-color: #e0e0e0;
        --text-secondary: #aaaaaa;
        --card-bg: #1e1e1e75;
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        --button-bg: #333333;
        --button-hover: #444444;
        --button-text: #e0e0e0;
        --telegram-blue: #1a9cd6;
        --footer-text: rgba(255, 255, 255, 0.7);
        --overlay-bg: rgba(0, 0, 0, 0.5);
        --overlay-dark-bg: rgba(0, 0, 0, 0.7);
    }
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans",
        "Helvetica Neue", sans-serif;
    color: var(--text-color);
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Контейнер страницы для правильного позиционирования футера */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Слайд-шоу */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    z-index: -1;
}

.slide.active {
    opacity: 1;
    z-index: -1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Затемнение для слайдов */
.slide::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .slide::after {
        background-color: var(--overlay-dark-bg);
    }
}

/* Основной контент - центрирование по вертикали и горизонтали */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 1rem;
    position: relative;
    z-index: 1;
    flex-grow: 1;
}

/* ==================== LIQUID GLASS СТИЛИ ==================== */
.GlassContainer {
    --corner-radius: 24px;
    --base-strength: 14px;
    --extra-blur: 2px;
    --softness: 12px;
    --tint-amount: 0;
    --tint-saturation: 2;
    --tint-hue: 180deg;
    --contrast: 1;
    --brightness: 1;
    --invert: 10%;

    --total-strength: calc(var(--base-strength) + var(--extra-blur));
    --edge-width: calc(0.3px + (var(--softness) * 0.1));
    --emboss-width: calc((var(--softness) * 0.38));
    --refraction-width: calc((var(--softness) * 0.3));

    position: relative;
    overflow: visible;
    pointer-events: none;
    width: 100%;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.GlassContent {
    position: relative;
    display: block;
    z-index: 100;
    overflow: hidden;
    border-radius: var(--corner-radius);
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: light) {
    .GlassContent {
        background-color: rgba(255, 255, 255, 0.85);
    }
}

.GlassMaterial {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: visible;
    pointer-events: none;
}

.GlassMaterial:after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    border-radius: var(--corner-radius);
    background-color: rgba(128, 128, 128, 0);
}

.GlassMaterial > div {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    border-radius: var(--corner-radius);
    z-index: 2;
    overflow: hidden;
}

.GlassMaterial .GlassEdgeReflection {
    z-index: 4;
    margin: calc(var(--total-strength) * -1);
    border-radius: calc(var(--corner-radius) + var(--total-strength));
    backdrop-filter: blur(var(--total-strength)) brightness(1.15) saturate(1.4) contrast(1.1);
    padding: var(--edge-width);
    border: var(--total-strength) solid transparent;
    mask: 
        linear-gradient(white 0 0) padding-box,
        linear-gradient(white 0 0) content-box;
    mask-composite: exclude, exclude;
}

.GlassMaterial .GlassEmbossReflection {
    backdrop-filter: blur(calc(var(--total-strength) * 1.5)) invert(0.25) brightness(1.11) saturate(1.2) hue-rotate(-10deg) contrast(2.3);
    padding: var(--emboss-width);
    border: 0 solid transparent;
    mask: 
        linear-gradient(white 0 0) padding-box,
        linear-gradient(white 0 0) content-box;
    mask-composite: exclude, exclude;
}

.GlassMaterial .GlassRefraction {
    backdrop-filter: invert(0.1) brightness(1.2) contrast(1.5);
    padding: var(--refraction-width);
    border: calc(var(--emboss-width)) solid transparent;
    mask: 
        linear-gradient(white 0 0) padding-box,
        linear-gradient(white 0 0) content-box;
    mask-composite: exclude, exclude;
}

.GlassMaterial .GlassBlur {
    backdrop-filter: blur(var(--extra-blur)) brightness(1.25);
    border-radius: calc(var(--corner-radius) - (var(--emboss-width) + var(--refraction-width)));
    margin: calc(var(--emboss-width) + var(--refraction-width));
}

.GlassMaterial .BlendLayers {
    z-index: 3;
    backdrop-filter: blur(calc((var(--softness) * 0.2) + (var(--extra-blur) * 0.2)));
}

.GlassMaterial .BlendEdge {
    z-index: 8;
    backdrop-filter: blur(calc(var(--edge-width) * 0.4)) contrast(1.6) saturate(1.5);
}

.GlassContainer:before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 20;
    display: block;
    border-radius: var(--corner-radius);
    backdrop-filter: invert(var(--invert)) brightness(0.95);
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .GlassContainer:before {
        backdrop-filter: invert(8%) brightness(0.9);
    }
}

.GlassMaterial:before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 11;
    display: block;
    border-radius: var(--corner-radius);
    padding: 1px;
    border: 0 solid transparent;
    background: linear-gradient(155deg, hsla(0, 0%, 100%, 0.25) 0%, hsla(0, 0%, 0%, 0.35) 50%, hsla(0, 0%, 100%, 0.2) 100%);
    backdrop-filter: invert(0.15) opacity(1);
    mask: 
        linear-gradient(white 0 0) padding-box,
        linear-gradient(white 0 0) content-box;
    mask-composite: exclude, exclude;
}

@media (prefers-color-scheme: dark) {
    .GlassMaterial:before {
        background: linear-gradient(155deg, hsla(0, 0%, 100%, 0.2) 0%, hsla(0, 0%, 0%, 0.45) 50%, hsla(0, 0%, 100%, 0.15) 100%);
    }
}

.GlassMaterial .Highlight {
    z-index: 12;
    display: block;
    border-radius: var(--corner-radius);
    padding: 1px;
    border: 0 solid transparent;
    backdrop-filter: brightness(1.2) contrast(1.6) saturate(1.2) opacity(1);
    mask: 
        linear-gradient(white 0 0) padding-box,
        linear-gradient(white 0 0) content-box;
    mask-composite: exclude, exclude;
}

/* Адаптация Liquid Glass под светлую тему */
@media (prefers-color-scheme: light) {
    .GlassContainer {
        --invert: 2%;
    }
    .GlassMaterial:before {
        background: linear-gradient(155deg, hsla(0, 0%, 100%, 0.25) 0%, hsla(0, 0%, 0%, 0.1) 50%, hsla(0, 0%, 100%, 0.2) 100%);
    }
}

/* Адаптация Liquid Glass под темную тему */
@media (prefers-color-scheme: dark) {
    .GlassContainer {
        --invert: 12%;
    }
}
/* ==================== КОНЕЦ LIQUID GLASS СТИЛЕЙ ==================== */

/* Общие стили для карточек (внутреннее содержимое) */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    width: 100%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.GlassContent {
    background-color: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: light) {
    .GlassContent {
        background-color: rgba(255, 255, 255, 0.7);
    }
}

/* Профильная карточка */
.profile-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.profile-username {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.social-links {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #cccccc;
}

/* Telegram карточка */
.telegram-card {
    padding: 2rem;
    display: flex;
    align-items: center;
}

.telegram-icon {
    position: relative;
    width: 78px;
    height: 69px;
    margin-right: 1.2rem;
    flex-shrink: 0;
}

.telegram-icon-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.telegram-info {
    flex: 1;
    padding: 0 0.5rem;
}

.telegram-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.telegram-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.subscribe-button {
    background-color: rgb(255 255 255);
    border: none;
    border-radius: 20px;
    padding: 0.7rem 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    color: #333333e8;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    margin-left: 1rem;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

.subscribe-button:hover {
    background-color: var(--button-hover);
    box-shadow: none;
}

/* Футер */
.footer {
    width: 100%;
    max-width: 600px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--footer-text);
    padding: 2rem 0;
    margin: 0 auto 1.5rem;
    transition: color 0.3s ease;
    align-self: center;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.GlassContainer {
    animation: fadeIn 0.5s ease forwards;
}

.GlassContainer:first-child {
    animation-delay: 0s;
}

.GlassContainer:last-child {
    animation-delay: 0.2s;
}

/* Адаптивность для разных устройств */
@media (min-width: 992px) {
    .content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .GlassContainer,
    .footer {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .profile-card {
        padding: 2rem 1.5rem;
    }

    .profile-image {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .telegram-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .telegram-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .telegram-info {
        margin-bottom: 1rem;
        text-align: center;
    }

    .subscribe-button {
        margin-left: 0;
    }

    .footer {
        padding: 1.5rem 0.5rem;
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 320px) {
    .profile-card {
        padding: 1.5rem 1rem;
    }

    .profile-image {
        width: 90px;
        height: 90px;
    }

    .social-links {
        font-size: 0.75rem;
    }

    .telegram-title {
        font-size: 0.9rem;
    }

    .telegram-description {
        font-size: 0.8rem;
    }

    .subscribe-button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .profile-image {
        width: 80px;
        height: 80px;
        margin-bottom: 0.5rem;
    }

    .profile-name {
        font-size: 1.2rem;
        margin-bottom: 0.1rem;
    }

    .profile-username {
        margin-bottom: 0.75rem;
    }

    .footer {
        padding-top: 1rem;
        margin-bottom: 0.5rem;
    }

    .profile-name,
    .profile-username,
    .telegram-title,
    .telegram-description,
    .social-links {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    @media (prefers-color-scheme: light) {
        .profile-name,
        .profile-username,
        .telegram-title,
        .telegram-description,
        .social-links {
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
    }
}