/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px; /* Место для парящего нижнего меню */
}

/* Заголовок приложения */
.app-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.back-button:active {
    transform: translateX(-1px);
    background: rgba(255, 255, 255, 0.15);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Блок профиля */
.profile-section {
    margin-bottom: 8px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar {
    position: relative;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--tg-theme-button-color, #007bff);
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.profile-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.renew-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 10px 24px rgba(67, 97, 238, 0.35);
    position: relative;
    overflow: hidden;
}

.renew-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 120%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -150%; }
    100% { left: 150%; }
}

.renew-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(76, 175, 80, 0.35);
}

.renew-btn:active {
    transform: translateY(0);
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.status-indicator.active {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.expired {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Блок анимации защиты */
.protection-animation {
    text-align: center;
    margin: 20px 0;
}

.shield-container {
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 50px 24px;
    color: white;
    position: relative;
    overflow: visible;
    text-align: center;
    border: none;
    box-shadow: none;
}

.shield-container::before {
    display: none !important;
}

.shield-container::after {
    display: none !important;
}

.shield {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    width: 140px;
    height: 140px;
}

.shield::before {
    display: none !important;
}

.shield::after {
    display: none !important;
}

.shield-icon {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    animation: none !important;
}

.shield-icon::before {
    display: none !important;
}

.shield-icon::after {
    display: none !important;
}

.shield-icon svg {
    width: 90px;
    height: 90px;
    transition: all 0.3s ease;
}

.protection-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 50%;
    animation: ripple 4s ease-out infinite;
    z-index: 1;
}

.protection-pulse.pulse-2 {
    width: 90px;
    height: 90px;
    border-color: rgba(67, 97, 238, 0.4);
    animation: ripple 4s ease-out infinite 1s;
}

.protection-pulse.pulse-3 {
    width: 90px;
    height: 90px;
    border-color: rgba(0, 212, 255, 0.3);
    animation: ripple 4s ease-out infinite 2s;
}

.protection-pulse.pulse-4 {
    width: 90px;
    height: 90px;
    border-color: rgba(67, 97, 238, 0.25);
    animation: ripple 4s ease-out infinite 3s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.shield-container h3 {
    display: none;
}

.shield-container p {
    display: none;
}

/* Блок ключа */
/* Установка и настройка */
.setup-section {
    margin: 20px 0;
}

.setup-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.setup-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.setup-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
}

.setup-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.setup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

@media (max-width: 480px) {
    .setup-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .setup-btn {
        width: 100%;
    }
}
.key-section {
    margin: 20px 0;
}

.key-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.key-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.copy-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Группа действий с ключом */
.key-actions-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.install-btn {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.45);
}

.install-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .key-actions-group {
        flex-direction: column;
    }
    
    .install-btn, .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

.key-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-display {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #ffffff;
    word-break: break-all;
    line-height: 1.4;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.key-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.protocol-badge, .location-badge {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.location-badge {
    background: #28a745;
}

/* Статистика */
.stats-section {
    margin: 20px 0;
}
.setup-page h2 {
    color: #ffffff;
    margin-bottom: 8px;
}

.setup-page p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

/* Контейнер страницы настройки устройств */
.setup-page {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    margin-top: 75px;
}

/* Герой-блок: сначала анимация, затем текст и кнопки */
.setup-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.setup-textblock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.setup-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.setup-caption {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.action-btn:hover { transform: translateY(-1px); }

.action-btn.primary {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(67, 97, 238, 0.35);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
}

/* Анимированный контейнер Lottie */
.device-illustration {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.device-illustration lottie-player,
.device-illustration .lottie {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn.primary {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.device-card {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Инструкции установки */
.instruction-section {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    margin-top: 75px;
}

.instruction-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.instruction-title {
    font-size: 22px;
    font-weight: 800;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.app-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.step h4 {
    font-size: 15px;
    margin-bottom: 6px;
}

.screenshot {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* Табы приложений на страницах настройки */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tab-btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(67,97,238,0.35);
}

.tab-content {
    display: none;
}

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

@media (max-width: 480px) {
    .apps-grid { grid-template-columns: 1fr; }
}

/* Иллюстрации устройств на страницах настройки */
.setup-hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: center;
}

.setup-textblock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setup-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.setup-caption {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.device-illustration {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-illustration svg {
    width: 100%;
    max-width: 340px;
    height: auto;
    animation: float 4s ease-in-out infinite;
}

.device-glow {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 50% 50%, rgba(103,126,234,0.35), rgba(118,75,162,0.0) 60%);
    pointer-events: none;
    animation: pulseGlow 5s ease-in-out infinite;
}

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

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

@media (max-width: 480px) {
    .setup-hero {
        grid-template-columns: 1fr;
    }
    .device-illustration svg {
        max-width: 280px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

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

/* Нижнее меню */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    display: flex;
    padding: 12px 16px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.nav-item.active {
    color: #ffffff;
}

.nav-item:hover {
    color: #ffffff;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

/* Цвета для разных иконок навигации */
.nav-item:nth-child(1) .nav-icon svg {
    color: #4CAF50; /* Зеленый для главной */
}

.nav-item:nth-child(2) .nav-icon svg {
    color: #2196F3; /* Синий для профиля */
}

.nav-item:nth-child(3) .nav-icon svg {
    color: #FF9800; /* Оранжевый для подписки */
}

.nav-item:nth-child(4) .nav-icon svg {
    color: #9C27B0; /* Фиолетовый для настроек */
}

.nav-item.active .nav-icon svg {
    color: #ffffff !important; /* Белый для активной иконки */
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* Уведомления */
.copy-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-notification.show {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }
    
    .profile-card {
        padding: 16px;
    }
    
    .profile-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .profile-info h2 {
        font-size: 18px;
    }
    
    .shield-container {
        padding: 40px 20px;
        overflow: visible;
    }
    
    .shield {
        width: 120px;
        height: 120px;
    }
    
    .shield-icon svg {
        width: 75px;
        height: 75px;
    }
    
    .protection-pulse {
        width: 75px;
        height: 75px;
    }
    
    .shield-container h3 {
        font-size: 18px;
        margin-top: 20px;
    }
    
    .shield-container p {
        font-size: 13px;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    /* Парящее меню на мобильных */
    .bottom-nav {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 10px 12px;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
    
    .nav-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
}

/* Стили для страницы профиля */
.profile-card-large {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar-large {
    position: relative;
}

.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--tg-theme-button-color, #007bff);
    object-fit: cover;
}

.avatar-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #28a745;
    border: 3px solid var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 50%;
}

.profile-details h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
}

.profile-details p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.join-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.join-icon {
    font-size: 16px;
}

/* Статистика использования */
.usage-stats {
    margin-bottom: 24px;
}

.usage-stats h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.stats-grid-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon-large {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 12px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.stat-content {
    flex: 1;
}

.stat-value-large {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label-large {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Активные ключи */
.active-keys, .activity-history {
    margin-bottom: 24px;
}

.active-keys h3, .activity-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.key-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #28a745;
    color: white;
}

.status-badge.inactive {
    background: #6c757d;
    color: white;
}

.key-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

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

.detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.key-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn-small {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* История активности */
.activity-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.activity-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 8px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.activity-content {
    flex: 1;
}

.activity-action {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.activity-location {
    font-weight: 500;
}

/* Действия профиля */
.profile-actions {
    margin-bottom: 24px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.action-btn.secondary {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #e9ecef);
}

.action-btn.danger {
    background: #dc3545;
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon {
    font-size: 18px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}

.modal-body {
    padding: 20px;
}

.key-detail-full h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.detail-section p {
    font-size: 14px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

/* Адаптивность для профиля */
@media (max-width: 480px) {
    .profile-card-large {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .profile-avatar-large img {
        width: 100px;
        height: 100px;
    }
    
    .stats-grid-large {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon-large {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .key-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Стили для страницы подписки */
.current-subscription {
    margin-bottom: 24px;
}

.subscription-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.subscription-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.subscription-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.subscription-status.active {
    background: #28a745;
    color: white;
}

.subscription-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.subscription-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tg-theme-hint-color, #e9ecef);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    display: block;
}

/* Тарифные планы */
.tariff-plans {
    margin-bottom: 24px;
}

.tariff-plans h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Новый блок выбора устройств/тарифов */
.tariff-subtitle { color: rgba(255,255,255,0.85); margin-top: 6px; margin-bottom: 12px; }

.devices-select { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.devices-label { font-weight: 700; margin-bottom: 10px; }
.devices-slider { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 10px 12px; background: rgba(0,0,0,0.2); border-radius: 999px; }
.devices-slider .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); background: transparent; cursor: pointer; }
.devices-slider .dot.active { background: #14b8a6; border-color: #14b8a6; box-shadow: 0 0 0 6px rgba(20,184,166,0.25); }

.plans-grid.modern { grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-modern { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border-radius: 16px; background: linear-gradient(160deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06)); border: 1px solid rgba(255,255,255,0.2); color: #fff; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border .2s ease; }
.plan-modern:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.plan-modern .plan-modern-title { font-weight: 700; }
.plan-modern .plan-modern-price { font-size: 22px; font-weight: 800; }
.plan-modern .plan-modern-note { font-size: 12px; color: rgba(255,255,255,0.8); }
.plans-grid.modern .plan-modern.popular {
    position: relative;
    border-color: rgba(124,58,237,0.6);
    background: linear-gradient(160deg, rgba(15,23,42,0.85), rgba(30,27,75,0.85));
    box-shadow: 0 12px 28px rgba(124,58,237,0.35);
}
.plan-modern.popular .plan-modern-title,
.plan-modern.popular .plan-modern-price,
.plan-modern.popular .plan-modern-note { color: #ffffff; }

/* Выделение выбранной карточки тарифа (для всех, включая популярный) */
.plans-grid.modern .plan-modern.selected {
    border-color: rgba(20,184,166,0.8);
    background: linear-gradient(135deg, rgba(20,184,166,0.28), rgba(14,165,233,0.28));
    box-shadow: 0 12px 28px rgba(14,165,233,.35);
}
.plans-grid.modern .plan-modern.popular.selected {
    border-color: rgba(20,184,166,0.9);
    background: linear-gradient(135deg, rgba(20,184,166,0.35), rgba(14,165,233,0.35));
}
.plan-modern.popular .popular-badge { position: absolute; top: -10px; left: 12px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }

.pay-modern-btn { width: 100%; margin-top: 16px; background: linear-gradient(135deg,#14b8a6,#0ea5e9); color: #fff; border: none; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 800; box-shadow: 0 12px 28px rgba(14,165,233,.35); }

@media (max-width: 480px) {
    .plans-grid.modern { grid-template-columns: 1fr 1fr; }
    .devices-slider { grid-template-columns: repeat(6, 1fr); }
}

.plan-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.plan-card.selected {
    border-color: var(--tg-theme-button-color, #007bff);
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.plan-card.popular {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.popular-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: #ffc107;
    color: #000000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    margin-bottom: 16px;
}

.plan-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.plan-card.selected .plan-header h4,
.plan-card.popular .plan-header h4 {
    color: #ffffff;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.plan-card.selected .price {
    color: #ffffff;
}

.period {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.discount {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
    margin-top: 4px;
}

.plan-features {
    margin-bottom: 20px;
}

.feature {
    font-size: 14px;
    margin-bottom: 8px;
    color: #ffffff;
}

.plan-btn {
    width: 100%;
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.plan-btn.primary {
    background: #ffc107;
    color: #000000;
}

.plan-card.selected .plan-btn {
    background: var(--tg-theme-button-text-color, #ffffff);
    color: var(--tg-theme-button-color, #007bff);
}

/* Способы оплаты */
.payment-methods {
    margin-bottom: 24px;
}

.payment-methods h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.payment-method {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.payment-method:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-method.selected {
    border-color: var(--tg-theme-button-color, #007bff);
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.payment-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.payment-method span {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.payment-method.selected span {
    color: var(--tg-theme-button-text-color, #ffffff);
}

/* Промокоды */
.promo-section {
    margin-bottom: 24px;
}

.promo-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.promo-card {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.promo-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.promo-input {
    flex: 1;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e9ecef);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

.promo-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #007bff);
}

.promo-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.promo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.promo-result {
    font-size: 14px;
    font-weight: 500;
}

.promo-success {
    color: #28a745;
}

.promo-error {
    color: #dc3545;
}

/* История платежей */
.payment-history {
    margin-bottom: 24px;
}

.payment-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.history-item {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.history-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 8px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.history-content {
    flex: 1;
}

.history-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.history-plan {
    font-size: 16px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.history-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-button-color, #007bff);
}

.history-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #6c757d);
}

.history-status {
    font-weight: 500;
}

/* Модальное окно оплаты */
.payment-summary {
    margin-bottom: 24px;
}

.payment-summary h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.payment-details {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.total-row {
    border-top: 1px solid var(--tg-theme-hint-color, #e9ecef);
    padding-top: 8px;
    font-weight: 600;
    font-size: 16px;
}

.discount-row {
    color: #28a745;
}

.payment-actions {
    text-align: center;
}

.payment-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.payment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Адаптивность для подписки */
@media (max-width: 480px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .promo-input-group {
        flex-direction: column;
    }
    
    .history-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .history-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Стили для страницы настроек */
.vpn-settings, .protocol-settings, .notification-settings, 
.privacy-settings, .advanced-settings, .app-info {
    margin-bottom: 24px;
}

.vpn-settings h3, .protocol-settings h3, .notification-settings h3,
.privacy-settings h3, .advanced-settings h3, .app-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.settings-group {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.setting-item.clickable {
    cursor: pointer;
}

.setting-item.clickable:hover {
    background: var(--tg-theme-bg-color, #ffffff);
    transform: translateX(4px);
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.setting-description {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.setting-arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 12px;
}

/* Переключатели */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

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

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

input:checked + .toggle-slider {
    background-color: #ffffff;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Кнопка сброса */
.reset-settings {
    margin-bottom: 24px;
    text-align: center;
}

.reset-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Модальные окна для настроек */
.protocol-list, .location-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.protocol-item, .location-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.protocol-item:hover, .location-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.protocol-item.selected, .location-item.selected {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.protocol-icon, .location-flag {
    font-size: 24px;
    margin-right: 16px;
    width: 40px;
    text-align: center;
}

.protocol-info, .location-info {
    flex: 1;
}

.protocol-name, .location-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
}

.protocol-item.selected .protocol-name,
.location-item.selected .location-name {
    color: #ffffff;
}

.protocol-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.protocol-item.selected .protocol-description {
    color: rgba(255, 255, 255, 0.8);
}

.location-ping {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.location-item.selected .location-ping {
    color: rgba(255, 255, 255, 0.8);
}

.protocol-check, .location-check {
    font-size: 18px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.protocol-item.selected .protocol-check,
.location-item.selected .location-check {
    opacity: 1;
    color: #ffffff;
}

/* Адаптивность для настроек */
@media (max-width: 480px) {
    .setting-item {
        padding: 12px;
    }
    
    .setting-label {
        font-size: 15px;
    }
    
    .setting-description {
        font-size: 13px;
    }
    
    .toggle-switch {
        width: 45px;
        height: 25px;
    }
    
    .toggle-slider:before {
        height: 17px;
        width: 17px;
        left: 4px;
        bottom: 4px;
    }
    
    input:checked + .toggle-slider:before {
        transform: translateX(20px);
    }
    
    .protocol-item, .location-item {
        padding: 12px;
    }
    
    .protocol-icon, .location-flag {
        font-size: 20px;
        margin-right: 12px;
        width: 32px;
    }
    
    .protocol-name, .location-name {
        font-size: 15px;
    }
    
    .protocol-description, .location-ping {
        font-size: 13px;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Темная тема - отключена, так как используется градиентный фон */
@media (prefers-color-scheme: dark) {
    /* Градиентный фон применяется ко всем темам */
}

/* Стили для страницы выбора устройств - новый дизайн */
.ms_cont_2 {
    display: flex;
    gap: 20px;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.ms_install_right {
    display: flex;
    gap: 47px;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

.ms_install_right h2 {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 30px;
    text-transform: none;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
}

.ms_install_right h2 u {
    color: #6b4aed;
    text-decoration: none;
    font-weight: 800;
}

.ms_cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
    grid-gap: 15px;
}

@media (max-width: 1199px) {
    .ms_cards {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        margin-bottom: 30px;
        max-height: 715px;
    }
    .ms_card {
        max-width: none !important;
    }
}

@media (max-width: 991px) {
    .ms_cards {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(1, 1fr);
        max-height: none;
    }
    .ms_cont_2 {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .ms_install_right {
        width: 100%;
    }
    .ms_install_right h2 {
        font-size: 28px;
        padding: 0 20px;
    }
}

@media (max-width: 767px) {
    .ms_cards {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        width: 100%;
        max-height: 715px;
        margin-top: 30px;
    }
}

@media (max-width: 600px) {
    .ms_install_right h2 {
        font-size: 20px;
        padding: 0 10px;
        margin-bottom: 24px;
    }
}

.ms_card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px 20px;
    transition: 0.5s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    min-height: 220px;
    height: auto;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ms_card:hover {
    transform: scale(1.08);
    background: #6b4aed;
    box-shadow: 0px 8px 24px rgba(107, 74, 237, 0.4);
    border-radius: 12px;
    z-index: 10;
    transition: 0.5s ease;
}

.ms_card svg {
    width: 64px;
    height: 64px;
    margin: 16px 0;
    flex-shrink: 0;
}

.ms_card svg path {
    transition: 0.5s ease;
}

.ms_card:hover svg path {
    fill: #fff;
    transition: 0.5s ease;
}

.ms_card p {
    color: #000;
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    transition: 0.5s ease;
    flex-shrink: 0;
}

.ms_card:hover p {
    color: #fff;
    transition: 0.5s ease;
}

.ms_card a {
    border-width: 0;
    font-weight: 700;
    font-size: 12px;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    transition: 0.5s ease, opacity 0s;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 6px;
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
}

.ms_card:hover a {
    opacity: 1;
    max-height: 40px;
    padding: 8px 20px;
    border-width: 2px;
    margin-top: 12px;
}

/* Адаптация для страницы настроек */
.setup-page .ms_cont_2 {
    padding: 0;
}

.setup-page .ms_install_right {
    padding: 0;
}

@media (max-width: 480px) {
    .setup-page .ms_cards {
        gap: 12px;
    }
    
    .setup-page .ms_card {
        max-width: none;
        min-height: 200px;
        padding: 20px 16px;
    }
    
    .setup-page .ms_card svg {
        width: 56px;
        height: 56px;
        margin: 12px 0;
    }
    
    .setup-page .ms_card p {
        font-size: 16px;
        margin: 10px 0 6px 0;
    }
    
    .setup-page .ms_card:hover a {
        padding: 7px 18px;
        font-size: 11px;
    }
}
