:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --accent: #ffd166;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #06d6a0;
    --warning: #ef476f;
    --font-main: 'Poppins', sans-serif;
    --font-title: 'Playfair Display', serif;
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: var(--light);
    min-height: 100vh;
    position: relative;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 35%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(255, 209, 102, 0.1) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
    opacity: 0.6;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 50px),
        repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 50px);
    z-index: -2;
    pointer-events: none;
    opacity: 0.3;
}

.container {
    display: flex;
    min-height: calc(100vh - 64px);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.sidebar {
    width: 25%;
    background: rgba(26, 42, 54, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 107, 107, 0.3);
    padding: 2rem;
    position: relative;
    text-align: center;
    min-width: 250px;
}

.profile {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto 1rem;
    object-fit: cover;
    filter: drop-shadow(0 0 15px rgba(255, 107, 107, 0.5));
}

.profile h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.5rem;
    font-family: var(--font-title);
}

.profile-card {
    background: rgba(26, 42, 54, 0.6);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    margin-bottom: 0.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.profile-card:hover::before {
    transform: scaleX(1);
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(6, 214, 160, 0.2);
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(6, 214, 160, 0.3);
    margin-bottom: 0.5rem;
}

.profile-info {
    font-size: 0.875rem;
    color: #b0bec5;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    width: 100%;
}

.profile-info span {
    color: var(--light);
    font-weight: 500;
    margin-right: 0.25rem;
}

.balance {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.wallet-address {
    display: block;
    text-align: center;
    margin-top: 0.25rem;
    font-size: clamp(0.45rem, 1.8vw, 0.61rem);
    max-width: 100%;
    word-break: break-all;
}

.subscriptions {
    margin-bottom: 2rem;
}

.subscriptions h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-title);
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subscription-card {
    background: rgba(26, 42, 54, 0.6);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    margin-bottom: 0.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.subscription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.subscription-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.subscription-card:hover::before {
    transform: scaleX(1);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.subscription-name {
    font-weight: 500;
    color: var(--light);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background-color: var(--success);
}

.subscription-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #b0bec5;
}

.days-left {
    font-weight: 600;
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.main-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1.5rem;
    font-family: var(--font-title);
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: rgba(26, 42, 54, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(255, 107, 107, 0.3);
    z-index: 0;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 2;
}

.service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-4px);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-image-container {
    position: relative;
    width: 100%;
    z-index: 1;
}

.service-image {
    width: 100%;
    height: 192px;
    object-fit: cover;
    display: block;
}

.price-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 3;
}

.service-content {
    padding: 1.5rem;
}

.service-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.75rem;
    font-family: var(--font-title);
}

.service-description {
    font-size: 0.875rem;
    color: #b0bec5;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    white-space: wrap;
}

.buy-btn {
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.buy-btn:hover {
    background: linear-gradient(90deg, #ff5252, #40c9c6);
    transform: scale(1.02);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1001; /* Повышаем z-index выше 1000 из styles.css */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    height: 100vh;
    width: 100vw;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(26, 42, 54, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translate(0, 0);
    transition: all 0.3s;
    border: 1px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0 auto !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 107, 107, 0.3);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
    font-family: var(--font-title);
    margin-right: 2rem;
    text-align: center;
}

.close-btn {
    background: none;
    border: none;
    color: #b0bec5;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    transition: color 0.2s;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.close-btn:hover {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.2);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-image {
    width: 100%;
    height: 192px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.modal-description {
    font-size: 0.875rem;
    color: #b0bec5;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: left; /* Выравнивание по левому краю */
}

#duration-select {
    max-width: 200px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    background: rgba(26, 42, 54, 0.6);
    color: var(--light);
    width: auto;
    margin: 0 auto;
    display: block;
}

#duration-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

#modal-price {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.features-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 1rem;
    font-family: var(--font-title);
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.features-list {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #b0bec5;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
    justify-content: center;
}

.feature-item:hover {
    background: rgba(255, 107, 107, 0.1);
}

.feature-icon {
    color: var(--success);
    font-size: 1.25rem;
}

.periods-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 1rem;
    font-family: var(--font-title);
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.periods-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.period-option {
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(26, 42, 54, 0.6);
}

.period-option:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.period-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.period-name {
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.5rem;
    text-align: center;
}

.period-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}

.period-savings {
    font-size: 0.875rem;
    color: var(--success);
    margin-top: 0.25rem;
    text-align: center;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 107, 107, 0.3);
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    max-width: 200px;
    text-align: center;
}

.cancel-btn {
    background: rgba(255, 107, 107, 0.1);
    color: #b0bec5;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.cancel-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--light);
}

.confirm-btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
}

.confirm-btn:hover {
    background: linear-gradient(90deg, #ff5252, #40c9c6);
    transform: scale(1.02);
}

.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border-radius: 8px;
    z-index: 2000;
    display: none;
    text-align: center;
    white-space: normal; /* Разрешаем перенос строки */
}

@media (max-width: 480px) {
    .notification {
        white-space: normal; /* Убеждаемся, что перенос работает на мобильных */
        max-width: 80%; /* Ограничиваем ширину для мобильных */
        padding: 8px 15px; /* Уменьшаем отступы */
        word-break: break-word; /* Принудительный перенос слов */
    }
}

/* Адаптивные стили */
@media (max-width: 1024px) {
    .sidebar {
        width: 30%;
    }
    .nav-list {
        gap: 1rem;
    }
    .nav-link {
        padding: 0.35rem 0.7rem;
        font-size: 1.4rem;
    }
    .nav-icon {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 107, 107, 0.3);
    }
    .container {
        flex-direction: column;
    }
    .nav-list {
        gap: 0.6rem;
        padding: 0.5rem 0;
        justify-content: center;
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .nav-item {
        flex: 0 1 auto;
    }
    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 1.2rem;
        justify-content: center;
    }
    .nav-icon {
        width: 16px;
        height: 16px;
    }
    .page-title {
        font-size: 2rem;
    }
    .main-content {
        padding: 1rem;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .modal-body, .modal-footer, .modal-header {
        padding: 1rem;
    }
    .modal-title {
        font-size: 1.25rem;
    }
    .modal-content {
        padding: 1.5rem;
        max-width: 90%;
        width: 100%;
        margin: 1rem 0.5rem;
    }
    .modal-content label {
        font-size: 0.95rem;
    }
    .modal-content input {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
    .modal-content button {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
    .register-link {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 1rem;
    }
    .profile h2 {
        font-size: 1.125rem;
    }
    .nav-list {
        gap: 0.4rem;
        padding: 0.4rem 0;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
    }
    .nav-item {
        flex: 0 1 auto;
    }
    .nav-link {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
        justify-content: center;
        text-align: center;
    }
    .nav-icon {
        width: 14px;
        height: 14px;
    }
    .page-title {
        font-size: 1.8rem;
    }
    .main-content {
        padding: 1rem;
    }
    .modal-body, .modal-footer, .modal-header {
        padding: 1rem;
    }
    .modal-title {
        font-size: 1.25rem;
    }
    footer {
        padding: 1.8rem 0.8rem;
    }
    .modal-content {
        padding: 1rem;
        max-width: 95%;
        width: 100%;
        margin: 0.5rem;
    }
    .modal-content label {
        font-size: 0.9rem;
    }
    .modal-content input {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    .modal-content button {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    .register-link {
        font-size: 0.8rem;
    }
    .close {
        font-size: 1.2rem;
    }
}

.subscription-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.subscription-item {
    background: rgba(26, 42, 54, 0.6);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
    transition: var(--transition);
}

.subscription-name, .subscription-expiry, .subscription-role {
    display: block;
    color: var(--light);
    font-size: 0.9rem;
}

.subscription-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto 1rem;
    object-fit: cover;
    filter: drop-shadow(0 0 15px rgba(255, 107, 107, 0.5));
}

.avatar.subscriber {
    border-color: rgba(78, 205, 196, 0.3);
}

.avatar.user {
    border-color: rgba(255, 209, 102, 0.3);
}

.avatar.premium {
    border-color: rgba(255, 107, 107, 0.5);
}

.avatar.admin {
    border-color: rgba(6, 214, 160, 0.5);
}

/* Удалены дублирующиеся стили - используется основное определение выше */
.subscription-item {
    margin-bottom: 10px;
}
.subscription-expiry, .subscription-remaining, .subscription-role {
    display: block; /* Каждый span на новой строке */
}

/* Кнопка выхода */
.logout-btn {
    background: linear-gradient(135deg, #ef476f, #ff6b6b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 15px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ff6b6b, #ef476f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(239, 71, 111, 0.3);
}

/* Стили для модального окна ожидания */
.processing-modal {
    max-width: 400px;
    text-align: center;
}

.processing-content {
    padding: 40px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 107, 107, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-title {
    font-family: var(--font-title);
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.processing-description {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.processing-timer {
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
}

.processing-timer span {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Анимация пульсации для таймера */
.processing-timer span {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Принудительное обновление цены */
.price-updated {
    animation: priceUpdate 0.1s ease-in-out;
}

@keyframes priceUpdate {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 1; }
}