:root {
    --primary-color: #ff6600; /* Оранжевый */
    --dark-bg: #1e2633;      /* Темно-синий */
    --light-gray: #f4f4f4;
    --text-main: #333;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--text-main);
    background-color: #fff;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10%;
    background-color: var(--dark-bg);
    color: white;
}

.logo a {
    color: white;
    font-size: 1.4em;
    font-weight: bold;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #ccc;
    transition: 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

/* ===== UNIFIED BUTTON STYLES ===== */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-info,
.btn-warning,
input[type="submit"],
a.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1em;
    text-align: center;
    vertical-align: middle;
}

.btn-primary,
button[type="submit"],
input[type="submit"] {
    background-color: var(--primary-color);
    color: white !important;
}

.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.btn-primary:active,
button[type="submit"]:active,
input[type="submit"]:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6c757d;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white !important;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

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

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-info {
    background-color: #17a2b8;
    color: white !important;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529 !important;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn:disabled,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover,
button:disabled:hover,
input[type="submit"]:disabled:hover {
    box-shadow: none;
}

/* Сетка контента */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Главный баннер (Hero) */
.hero {
    display: flex;
    background-color: var(--primary-color);
    color: white;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 50px;
}

.hero-text {
    padding: 60px;
    flex: 1;
}

.hero-text h1 {
    font-size: 3em;
    margin: 0 0 20px 0;
}

/* Карточки товаров/услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.service-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    margin-top: 0;
    color: var(--dark-bg);
}

.price-tag {
    font-size: 1.5em;
    font-weight: bold;
    margin: 15px 0;
}

.pay-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.pay-btn:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

/* Таблицы для Админки */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th {
    padding: 15px;
    text-align: left;
    color: #888;
}

td {
    background: #fdfdfd;
    padding: 15px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* --- Адаптивность для мобильных устройств --- */

@media (max-width: 768px) {
    /* 1. Хедер: превращаем в колонку или разрешаем перенос */
    header {
        flex-direction: column;
        padding: 15px 5%;
        gap: 15px;
        text-align: center;
    }

    nav {
        flex-wrap: wrap; /* Если ссылок много, они перенесутся на новую строку */
        justify-content: center;
        gap: 10px;
    }


    /* 2. Баннер (Hero): текст и картинка теперь друг под другом */
    .hero {
        flex-direction: column;
    }

    .hero-text {
        padding: 30px 20px;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 1.8em; /* Уменьшаем заголовок, чтобы не вылезал */
    }

    /* 3. Сетка товаров: строго одна колонка */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .container {
        padding: 0 15px;
        margin-top: 20px;
    }

    /* 4. Таблицы в админке: добавляем горизонтальный скролл */
    /* На мобилках таблицы — это боль, поэтому оборачиваем их в div со скроллом */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap; /* Чтобы колонки не слипались */
    }

    /* 5. Формы: делаем инпуты на всю ширину */
    input[type="text"],
    input[type="number"],
    textarea,
    .editor {
        width: 100%;
        box-sizing: border-box; /* Чтобы padding не увеличивал ширину */
    }
        .article {
        padding: 0 15px;
        margin: 30px auto;
    }

    .article h1 {
        font-size: 1.8em;
    }

    .article h2 {
        font-size: 1.5em;
    }

    .article p,
    .article li {
        font-size: 0.95em;
    }
        .example-box {
        padding: 15px;
        margin: 20px 0;
    }

    .example-box::before {
        font-size: 0.7em;
        padding: 3px 8px;
    }
}

/* Стили кнопки бургера */
.menu-toggle {
    display: none; /* Скрыто на десктопе */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* Адаптивность */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; /* Показываем на мобилках */
    }

    nav {
        display: none; /* Скрываем обычное меню */
        flex-direction: column;
        width: 100%;
        background-color: var(--dark-bg);
        position: absolute;
        top: 60px; /* Высота хедера */
        left: 0;
        padding: 20px 0;
        z-index: 1000;
    }

    /* Когда меню активно (добавим через JS) */
    nav.active {
        display: flex;
    }

    nav a {
        padding: 10px;
        width: 100%;
        text-align: center;
    }

    .btn-primary {
        margin: 10px auto;
        width: 80%;
    }

    /* Скрываем стандартный заголовок таблицы */
    .mobile-optimized thead {
        display: none;
    }

    .mobile-optimized,
    .mobile-optimized tbody,
    .mobile-optimized tr,
    .mobile-optimized td {
        display: block;
        width: 100%;
    }

    .mobile-optimized tr {
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 10px;
        background: #fff;
        padding: 10px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }

    .mobile-optimized td {
        text-align: right;
        padding: 10px 15px;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .mobile-optimized td:last-child {
        border-bottom: none;
    }

    /* Вставляем название колонки перед данными */
    .mobile-optimized td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: var(--dark-bg);
        text-transform: uppercase;
        font-size: 0.8em;
    }
}

/* Цвета для кнопок в списке позиций */
.btn-edit {
    background-color: #17a2b8;
    color: white !important;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-delete-full {
    background-color: #dc3545;
    color: white !important;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-full:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Стили для flash-сообщений */
.flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
}

.flash-message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.5s ease forwards;
}

.flash-message.success { background-color: #28a745; }
.flash-message.error { background-color: #dc3545; }
.flash-message.info { background-color: #17a2b8; }
.flash-message.warning { background-color: #ffc107; color: #212529; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}
/* Кнопка закрытия сообщения */
.flash-message .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
}
.flash-message.warning .close-btn {
    color: #212529;
}
/* Полный редактор */
.editor {
    border: 1px solid #ccc;
    border-radius: 8px;
    min-height: 200px;
    padding: 10px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1em;
    box-sizing: border-box;
}
.editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(255, 102, 0, 0.5);
}
.editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}
/* Стили для полной страницы услуги */
.service-full-description {
    margin-top: 20px;
    line-height: 1.6;
}
.service-full-description h2,
.service-full-description h3 {
    color: var(--dark-bg);
}
.service-full-description a {
    color: var(--primary-color);
    text-decoration: underline;
}
.service-full-description a:hover {
    color: darken(var(--primary-color), 10%);
}
/* Стили для формы оплаты */
.payment-form {
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    background: white;
}

.payment-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.payment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.payment-form input[type="text"],
.payment-form input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.payment-form button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.payment-form button:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}
/* Стили для страницы кабинета клиента */
.client-cabinet {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}
.client-cabinet h1 {
    text-align: center;
    margin-bottom: 30px;
}
.client-cabinet .info-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.client-cabinet .info-section h2 {
    margin-top: 0;
}
.client-cabinet .info-section p {
    line-height: 1.6;
}
.client-cabinet .referral-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.client-cabinet .referral-stats .stat {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    margin: 0 10px;
}
.client-cabinet .referral-stats .stat h3 {
    margin: 0 0 10px 0;
}
.client-cabinet .referral-stats .stat p {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
}
/* Стили для страницы оплаты услуги */
.payment-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.payment-page h1 {
    text-align: center;
    margin-bottom: 30px;
}

.payment-page .service-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.payment-page .service-details h2 {
    margin-top: 0;
}

.payment-page .service-details p {
    line-height: 1.6;
}

.payment-page .total-amount {
    font-size: 1.5em;
    font-weight: bold;
    text-align: right;
    margin-top: 20px;
}

.payment-page .pay-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.payment-page .pay-btn:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}
/* Стили для страницы ошибки 404 */
.error-404 {
    text-align: center;
    padding: 100px 20px;
}

.error-404 h1 {
    font-size: 6em;
    margin: 0 0 20px 0;
    color: var(--primary-color);
}

.error-404 p {
    font-size: 1.5em;
    margin-bottom: 30px;
}

.error-404 a {
    background: var(--primary-color);
    color: white !important;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.error-404 a:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary-color);
    text-align: center;
}

.stat-card h4 {
    margin: 0;
    color: #888;
    font-size: 0.9em;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--dark-bg);
    margin: 10px 0;
}

.chart-container {
    position: relative;
    height: 300px; /* Фиксируем высоту */
    width: 100%;
}

.btn-light {
    background-color: #f8f9fa;
    color: #333 !important;
    border: 1px solid #ddd;
}

.btn-light:hover {
    background-color: #e2e6ea;
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-active {
    background-color: var(--primary-color);
    color: white !important;
    border: 1px solid var(--primary-color);
}

.btn-active:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

/* Кнопки в админ-панели */
.admin-btn {
    padding: 8px 15px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

/* Специальная кнопка для услуг (white variant) */
.btn-white {
    background-color: white;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
    padding: 12px 25px;
}

.btn-white:hover {
    background-color: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

/* Стили для статей */
.article {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.article h1,
.article h2,
.article h3,
.article h4,
.article h5,
.article h6 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-bg);
}

.article p {
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
}

.article ul,
.article ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.article blockquote {
    background-color: var(--light-gray);
    border-left: 4px solid var(--primary-color);
    margin: 20px 0;
    padding: 15px 20px;
    font-style: italic;
    color: #555;
}

.article img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: opacity 0.3s;
}

.article a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.article .highlight {
    background-color: rgba(255, 102, 0, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
}

.article .meta {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 30px;
    text-align: center;
}


/* Стили для эмодзи и иконок в статьях */
.emoji {
    font-size: 1.2em;
    margin: 0 5px;
    vertical-align: middle;
}

.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin: 0 8px;
    vertical-align: text-bottom;
}

/* Конкретные иконки (можно заменить на SVG/font-icons) */
/* .icon.table { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 3h18v18H3V3zm2 2v2h2V5H5zm8 0v2h8V5h-8zm-8 4v8h2v-8H5zm8 0v8h8v-8h-8zm0 10v2h8v-2h-8z"/></svg>'); }
.icon.chart { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 14H7v-4h4v4zm6 0h-2v-6h2v6zm2-8v2h-2V9h2z"/></svg>'); }
.icon.stats { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 11h6v6H9v-6zm0-8h6v2H9V3zm0 16h6v2H9v-2zM3 11h2v6H3v-6zm16-8h2v2h-2V3zm0 16h2v2h-2v-2z"/></svg>'); }
.icon.alert { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>'); color: #dc3545; }
.icon.rocket { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M22 16.5c0 .83-.67 1.5-1.5 1.5S19 17.33 19 16.5V12c0-.55-.22-1.05-.59-1.41L12 4.12l-6.41 6.47C5.22 10.95 5 11.45 5 12v4.5C5 17.33 4.33 18 3.5 18S2 17.33 2 16.5v-11C2 4.67 2.67 4 3.5 4h17c.83 0 1.5.67 1.5 1.5v11z"/></svg>'); } */


/* Анимация для ракет */
@keyframes rocketFly {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(15deg); }
    100% { transform: translateY(0) rotate(0deg); }
}
.icon.rocket {
    animation: rocketFly 2s infinite;
}

/* Стили для примеров и примечаний */
.example-box {
    background-color: rgba(255, 102, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.example-box::before {
    content: "Пример";
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8em;
    padding: 4px 10px;
    border-bottom-left-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.note {
    font-style: italic;
    color: #666;
    margin-top: 15px;
    padding-left: 30px;
    position: relative;
}

.note::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 6px;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Конец стилей */

