/* Космические стили */
:root {
    --cosmic-primary: #6a11cb;
    --cosmic-secondary: #2575fc;
    --cosmic-accent: #ff4b91;
    --cosmic-nebula: #8a2be2;
    --cosmic-stars: #ffffff;
    --cosmic-dark: #0f0c29;
    --cosmic-darker: #07051c;
    --cosmic-card: rgba(255, 255, 255, 0.1);
    --cosmic-glow: rgba(106, 17, 203, 0.5);
}

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

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo+2:wght@300;400;600;700&display=swap');

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--cosmic-darker);
    color: white;
    overflow: hidden;
    height: 100vh;
}

/* Космический фон */
.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: stars-move 200s linear infinite;
}

.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: twinkle 4s ease-in-out infinite alternate;
}

.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0.3;
    animation: clouds-move 150s linear infinite;
}

.nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(106, 17, 203, 0.2) 0%,
        rgba(37, 117, 252, 0.1) 40%,
        transparent 70%);
    animation: nebula-pulse 8s ease-in-out infinite;
}

@keyframes stars-move {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    100% { opacity: 0.8; }
}

@keyframes clouds-move {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes nebula-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Экран загрузки */
.loading-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--cosmic-dark) 0%, var(--cosmic-darker) 100%);
}

.loading-container {
    text-align: center;
    z-index: 10;
}

.cosmic-loader {
    position: relative;
    margin-bottom: 2rem;
}

.planet-orbit {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: orbit-rotate 10s linear infinite;
}

.planet {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    border-radius: 50%;
    box-shadow: 0 0 20px var(--cosmic-glow);
}

.rocket {
    position: absolute;
    top: 50%;
    left: -25px;
    transform: translateY(-50%);
    animation: rocket-orbit 3s ease-in-out infinite;
}

.rocket-body {
    position: relative;
    width: 50px;
    height: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff4b91);
    border-radius: 10px 4px 4px 10px;
}

.rocket-wing {
    position: absolute;
    width: 10px;
    height: 15px;
    background: #ff4b91;
    top: -5px;
}

.rocket-wing.left {
    left: 5px;
    transform: skew(20deg);
}

.rocket-wing.right {
    right: 5px;
    transform: skew(-20deg);
}

.rocket-flame {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 8px;
    background: linear-gradient(90deg, #ff4b91, #ff6b6b, #ff8e53);
    border-radius: 0 4px 4px 0;
    animation: flame 0.5s ease-in-out infinite alternate;
}

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

@keyframes rocket-orbit {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

@keyframes flame {
    from { opacity: 0.7; transform: translateY(-50%) scaleX(1); }
    to { opacity: 1; transform: translateY(-50%) scaleX(1.2); }
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px var(--cosmic-glow));
    animation: logo-float 3s ease-in-out infinite;
}

.cosmic-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px var(--cosmic-glow);
}

.cosmic-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 2rem auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--cosmic-primary), var(--cosmic-accent));
    border-radius: 3px;
    animation: loading 3s ease-in-out;
    box-shadow: 0 0 10px var(--cosmic-glow);
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.loading-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Экран авторизации */
#authScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 1rem;
}

.auth-container {
    max-width: 400px;
    width: 100%;
}

.cosmic-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.planet-header {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
}

.floating-planet {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    border-radius: 50%;
    animation: planet-float 6s ease-in-out infinite;
    box-shadow: 0 0 50px var(--cosmic-glow);
}

@keyframes planet-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(120deg); }
    66% { transform: translateY(5px) rotate(240deg); }
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 2rem auto 1rem;
    filter: drop-shadow(0 0 15px var(--cosmic-glow));
}

.auth-features {
    margin: 2rem 0;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    width: 40px;
    text-align: center;
}

.cosmic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 16px;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cosmic-btn.primary {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    color: white;
    box-shadow: 0 10px 30px var(--cosmic-glow);
}

.cosmic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px var(--cosmic-glow);
}

.btn-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.auth-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item span {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Главное приложение */
.screen {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Космическая шапка */
.cosmic-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    position: relative;
    z-index: 100;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(106, 17, 203, 0.1) 0%,
        rgba(37, 117, 252, 0.05) 100%);
    z-index: -1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    width: 32px;
    height: 32px;
}

.app-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--cosmic-accent);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Основной контент */
.cosmic-main {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.app-screen {
    display: none;
    height: 100%;
    flex-direction: column;
    padding-bottom: 80px;
}

.app-screen.active {
    display: flex;
}

/* Карточки для свайпов */
.cosmic-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
}

.cards-stack {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 500px;
    margin-bottom: 2rem;
}

.user-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: grab;
}

.user-card:active {
    cursor: grabbing;
}

.user-card img {
    width: 100%;
    height: 70%;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-age {
    font-size: 1.2rem;
    opacity: 0.8;
}

.card-bio {
    margin-bottom: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

.card-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.interest-tag {
    background: rgba(106, 17, 203, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(106, 17, 203, 0.5);
}

.swipe-indicators {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

.indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.indicator.active {
    opacity: 1;
}

.indicator-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Космические кнопки действий */
.cosmic-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.action-btn {
    position: relative;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.cosmic-dislike {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cosmic-dislike .btn-glow {
    background: radial-gradient(circle, rgba(255, 59, 59, 0.4) 0%, transparent 70%);
}

.cosmic-like {
    background: rgba(255, 75, 145, 0.2);
    border: 2px solid rgba(255, 75, 145, 0.5);
}

.cosmic-like .btn-glow {
    background: radial-gradient(circle, rgba(255, 75, 145, 0.4) 0%, transparent 70%);
}

.cosmic-superlike {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.5);
}

.cosmic-superlike .btn-glow {
    background: radial-gradient(circle, rgba(255, 193, 7, 0.4) 0%, transparent 70%);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn:hover .btn-glow {
    opacity: 1;
}

.action-btn:active {
    transform: scale(0.95);
}

/* Навигация */
.cosmic-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    max-width: 80px;
}

.nav-item.active {
    color: white;
}

.nav-item.active .nav-icon {
    transform: translateY(-5px);
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.nav-item span:not(.nav-icon) {
    font-size: 0.7rem;
}

.nav-badge {
    position: absolute;
    top: 0;
    right: 10px;
    background: var(--cosmic-accent);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Альтернативная навигация */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.nav-btn.active {
    color: white;
}

.nav-btn svg {
    margin-bottom: 0.25rem;
}

/* Чаты */
.cosmic-chats {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.chat-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chat-preview {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.chat-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.chat-unread {
    background: var(--cosmic-accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

/* Симпатии */
.cosmic-likes {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.likes-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.likes-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.likes-content {
    flex: 1;
    overflow-y: auto;
}

.tab-content {
    display: none;
    padding: 1rem;
    height: 100%;
}

.tab-content.active {
    display: block;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.like-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.like-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.like-photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.like-name {
    font-weight: 600;
    margin: 0.5rem 0 0.25rem;
}

.like-age {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Профиль */
.cosmic-profile {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--cosmic-primary);
}

.online-status {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border: 3px solid var(--cosmic-dark);
    border-radius: 50%;
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--cosmic-primary);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.profile-info {
    margin-bottom: 1rem;
}

.profile-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.profile-sections {
    margin-bottom: 2rem;
}

.section {
    margin-bottom: 2rem;
}

.section h3 {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.interest {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.settings-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.cosmic-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cosmic-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-accent));
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.edit-profile-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Модальные окна */
.cosmic-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.cosmic-modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    color: white;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; /* Исправление для предупреждения */
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cosmic-primary);
    background: rgba(255, 255, 255, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Фильтры */
.filter-group {
    margin-bottom: 2rem;
}

.filter-group h3 {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.age-range {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.age-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; /* Исправление для предупреждения */
}

.age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--cosmic-primary);
    border-radius: 50%;
    cursor: pointer;
}

.age-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--cosmic-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.interests-filter,
.interests-edit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.interests-filter label,
.interests-edit label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.interests-filter label:hover,
.interests-edit label:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Анимации свайпов */
@keyframes swipeRight {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(500px) rotate(30deg);
        opacity: 0;
    }
}

@keyframes swipeLeft {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-500px) rotate(-30deg);
        opacity: 0;
    }
}

.swipe-right {
    animation: swipeRight 0.5s forwards;
}

.swipe-left {
    animation: swipeLeft 0.5s forwards;
}

/* Сообщения об отсутствии контента */
.no-cards,
.no-chats,
.no-likes {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.no-cards h3,
.no-chats h3 {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Отладочные стили */
.debug-border {
    border: 2px solid red !important;
}

/* Гарантируем что кнопки кликабельны */
.cosmic-btn, .action-btn, .nav-btn, .nav-item, .icon-btn, .tab-btn {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none;
}

/* Гарантируем что модальные окна поверх всего */
.modal {
    z-index: 1000 !important;
}

/* Убедимся что экраны перекрывают друг друга */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.screen:not(.active) {
    display: none !important;
}

/* Улучшаем скроллбар */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Адаптивность */
@media (max-width: 480px) {
    .cosmic-title {
        font-size: 2rem;
    }
    
    .loading-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .cosmic-actions {
        gap: 1rem;
    }
    
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    .cards-stack {
        height: 450px;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .interests-filter,
    .interests-edit {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .profile-stats {
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 360px) {
    .cosmic-title {
        font-size: 1.75rem;
    }
    
    .cosmic-subtitle {
        font-size: 1rem;
    }
    
    .loading-bar {
        width: 250px;
    }
    
    .cards-stack {
        height: 400px;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-name {
        font-size: 1.25rem;
    }
}

/* Исправления для специфических браузеров */
@supports not (backdrop-filter: blur(20px)) {
    .cosmic-card,
    .cosmic-header,
    .cosmic-nav,
    .bottom-nav,
    .modal-content,
    .user-card {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Улучшения для темной темы */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--cosmic-darker);
    }
}

/* Анимации для улучшения UX */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Улучшения для доступности */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Фокус для доступности */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--cosmic-accent);
    outline-offset: 2px;
}

/* Улучшения для высоких экранов */
@media (min-height: 800px) {
    .cards-stack {
        height: 550px;
    }
    
    .cosmic-cards-container {
        justify-content: flex-start;
        padding-top: 2rem;
    }
}

/* Исправления для работы приложения */
.user-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-photo {
    width: 100%;
    height: 70%;
    object-fit: cover;
}

/* Гарантируем что все кнопки кликабельны */
button {
    cursor: pointer;
    pointer-events: auto;
}

/* Улучшаем отображение карточек */
.cards-stack {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 500px;
}

/* Исправляем навигацию */
.cosmic-nav {
    z-index: 1000;
}

/* Улучшаем адаптивность */
@media (max-width: 480px) {
    .cards-stack {
        height: 450px;
    }
    
    .user-card {
        height: 450px;
    }
}