/* ========== БАЗОВЫЕ СТИЛИ (исходные) ========== */

/* Общий контейнер */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #58658c;
    background-color: #f5f7fa;
}

.header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Вместо фиксированной ширины ставим max-width и центрируем */
.header-inner {
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 20px; /* Добавляем боковые отступы, чтобы не прилипало к краям экрана */
}

.logo {
    display: flex;
    align-items: center;
}

/* Подгоняем ширину логотипа, дальше можно адаптировать в медиазапросах */
.logo-img {
    width: 60px;
    height: auto;
}

.logo-text {
    margin-left: 8px;
    font-size: 20px;
    color: #192252;
    font-weight: bold;
}

.header-right {
    display: flex;
    gap: 15px;
}

.header-btn {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #1c7ce2;
    color: #1c7ce2;
}

.login-btn {
    background-color: #1c7ce2;
    color: #ffffff;
    border: none;
}

.register-btn {
    background-color: #ffffff;
    color: #1c7ce2;
    border: 1px solid #1c7ce2;
}

.logout-btn {
    background-color: #1c7ce2;
    color: #ffffff;
    border: none;
}

.username {
    color: #192252;
    font-weight: bold;
    display: inline-block;
    margin-right: 10px;
    margin-top: 8px;
}

/* Аналогично заменяем ширину контейнера */
.container {
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
    min-height: 500px;
    padding: 20px 20px; /* небольшой горизонтальный паддинг */
}

.footer {
    width: 100%;
    background-color: #fff;
    height: 50px;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer p {
    color: #999;
}

.index-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
}

.index-left {
    max-width: 700px;
}

.big-title {
    color: #192252;
    font-size: 36px;
}

.subtitle {
    color: #58658c;
    font-size: 18px;
    margin-top: 10px;
}

.index-right .index-image {
    width: 500px;
    height: auto;
}

.auth-container,
.settings-container,
.dashboard-container,
.subscription-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.section-title {
    color: #192252;
    margin-bottom: 20px;
}

.error-message {
    color: red;
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #192252;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-primary {
    background-color: #1c7ce2;
    color: #ffffff;
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: #1255a3;
}

.dashboard-info p {
    margin: 5px 0;
}

.dashboard-links {
    margin-top: 20px;
}

.btn-dashboard {
    display: inline-block;
    margin-right: 10px;
    padding: 8px 14px;
    background-color: #ffffff;
    color: #1c7ce2;
    border: 1px solid #1c7ce2;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 10px;
}
.btn-dashboard:hover {
    background-color: #1c7ce2;
    color: #ffffff;
}

.template-item, .custom-template-item {
    background-color: #f9fafc;
    padding: 10px;
    border-radius: 6px;
}

.btn-delete {
    color: #ff5050;
    text-decoration: none;
    margin-left: 15px;
}
.btn-delete:hover {
    text-decoration: underline;
}

.subscription-list {
    display: flex;
    gap: 20px;
}

.subscription-item {
    width: 260px;
    background-color: #fff;
    padding: 16px;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 8px;
}

.subscription-icon {
    width: 60%;
    margin-bottom: 10px;
}

.subscription-title {
    color: #192252;
    font-size: 20px;
    margin-bottom: 10px;
}

.subscription-price {
    color: #1c7ce2;
    font-size: 20px;
    margin-bottom: 10px;
}

.subscription-desc {
    margin-bottom: 15px;
}

.btn-subscribe {
    background-color: #1c7ce2;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-subscribe:hover {
    background-color: #1255a3;
}

.tooltip {
    display: none;
    position: absolute;
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 10px;
    width: 300px;
    color: #000;
    z-index: 9999;
}

.underlined:hover + .tooltip {
    display: block;
}

/* Активная вкладка */
.btn-dashboard.active {
    background-color: #1c7ce2;
    color: #fff;
}

/* Удаление иконки */
.delete-icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    vertical-align: middle;
}

/* Иконка */
.delete-icon {
    width: 24px;
    /* height: 16px; */
}

/* Модальное окно */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fff;
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 400px;
    border-radius: 8px;
    position: relative;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #000;
}

/* Пример блочного расположения кастомных шаблонов */
.custom-template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Стили для переключателя */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.checkbox-label {
    font-weight: 500;
    color: #192252;
}

/* Анимированный переключатель */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #1c7ce2;
}
input:checked + .slider:before {
    transform: translateX(26px);
}
/* Эффект нажатия */
.slider:active:before {
    transform: scale(1.15);
    transition: transform 0.1s;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    /* Базовые настройки */
    body {
        font-size: 14px;
    }

    .header-inner {
        width: 95%;
        padding: 0 10px;
    }

    .logo-img {
        width: 30px;
        height: 30px;
    }

    .logo-text {
        font-size: 18px;
    }

    .header-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .container {
        width: 95%;
        padding: 10px;
    }

    /* Формы и поля */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        font-size: 14px;
        padding: 12px;
    }

    .btn-primary,
    .btn-dashboard {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Подписки */
    .subscription-list {
        flex-direction: column;
        gap: 15px;
    }

    .subscription-item {
        width: 100%;
        padding: 15px;
    }

    /* Таблицы и списки */
    .custom-template-item {
        flex-wrap: wrap;
    }

    /* Навигация */
    .dashboard-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-dashboard {
        width: 100%;
        margin: 5px 0;
    }

    /* Модальные окна */
    .modal-content {
        width: 90%;
        padding: 15px;
    }

    /* Переключатель */
    .switch {
        width: 50px;
    }

    .slider:before {
        width: 22px;
        height: 22px;
    }

    /* Отступы и размеры */
    .section-title {
        font-size: 18px;
    }

    .footer p {
        font-size: 12px;
    }
}

/* Универсальные адаптивные стили */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1450px;
    margin: 0 auto;
}

/* Улучшенная мобильная навигация */
@media (max-width: 480px) {
    .header-right {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .header-btn {
        width: 100%;
    }

    .index-content {
        flex-direction: column-reverse;
        align-items: center;
    }

    .index-image {
        width: 100%;
        margin-top: 20px;
    }

    .subscription-icon {
        width: 50%;
    }
}

/* Дополнительные улучшения */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Кастомный чекбокс */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

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

input:checked + .slider {
    background-color: #1c7ce2;
}

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

/* Анимация кнопок */
.btn-primary,
.btn-dashboard {
    transition: all 0.3s ease;
}

.btn-primary:active,
.btn-dashboard:active {
    transform: scale(0.95);
}

/* Улучшенные тултипы */
.tooltip {
    position: fixed;
    max-width: 250px;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Адаптивные таблицы */
.table-responsive {
    overflow-x: auto;
}

table {
    min-width: 600px;
}

/* Стили для сенсорных устройств */
@media (hover: none) {
    .btn-dashboard:hover {
        background-color: #1c7ce2;
        color: white;
    }
}

/* Дополнительные медиа-запросы */
@media (max-width: 320px) {
    .header-btn {
        padding: 10px 15px;
        font-size: 12px;
    }

    .section-title {
        font-size: 16px;
    }
}