/* ===== ОСНОВНЫЕ СТИЛИ ===== */
:root {
    --primary-color: #2c3e50;     /* Темно-синий */
    --secondary-color: #34495e;   /* Чуть светлее */
    --accent-color: #3498db;      /* Светло-синий (акцент) */
    --light-bg: #ecf0f1;          /* Светлый фон */
    --dark-bg: #122620;           /* Темный фон (ваш цвет) */
    --text-light: #ffffff;
    --text-dark: #333333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

/* ===== БОКОВОЕ МЕНЮ ===== */
aside {
    background: linear-gradient(to bottom, var(--dark-bg), #1a3229);
    width: 260px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    color: var(--text-light);
    box-shadow: 3px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 15px;
}

.logo-header h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

/* Навигация */
aside nav ul {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

aside nav ul li {
    margin-bottom: 12px;
}

aside nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

aside nav ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

aside nav ul li a:hover,
aside nav ul li a.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: var(--accent-color);
    transform: translateX(5px);
}

.contact-info {
    font-size: 0.9rem;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.contact-info i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
main {
    flex-grow: 1;
    margin-left: 260px;
    padding: 40px;
    max-width: calc(100% - 260px);
}

.main-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.main-header h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-style: italic;
}

/* Секции */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.content-section h2 {
    color: var(--primary-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.content-section h2 i {
    margin-right: 10px;
}

/* Контейнер для таблиц */
.tables-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.info-table {
    flex: 1;
    min-width: 300px;
}

.info-table h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* Таблицы Bootstrap */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(52, 152, 219, 0.05);
}

.table td {
    border-color: #eee;
    vertical-align: middle;
    padding: 15px;
}

/* Блок преимуществ */
.advantages {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

.advantage-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    border-top: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.advantage-card i {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.advantage-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.advantage-card p {
    color: #666;
    font-size: 0.95rem;
}

/* ===== СТИЛИ ДЛЯ УСЛУГ (КВАДРАТНЫЕ КАРТОЧКИ) ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.service-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-left: 4px solid var(--accent-color);
    transition: all 0.4s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Контейнер для контента */
.service-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.service-header {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px 10px;
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.service-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 25px;
    word-break: break-word;
    hyphens: auto;
}

.expand-icon {
    position: absolute;
    right: 10px;
    color: var(--accent-color);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

/* Развернутая карточка */
.service-card.expanded {
    aspect-ratio: auto;
    grid-row: span 2;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
    z-index: 10;
}

.service-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Тело карточки (описание) */
.service-body {
    flex: 1;
    padding: 0 12px;
    display: none;
    background: white;
    overflow-y: auto;
    font-size: 0.85rem;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.service-body.active {
    display: block;
    max-height: 300px;
    opacity: 1;
    padding: 12px;
}

.service-body p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}

/* Цена */
.service-price {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-color);
    padding: 8px 12px;
    border-top: 1px dashed rgba(52, 152, 219, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.9);
    flex-shrink: 0;
    margin-top: auto;
}

.service-price small {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: normal;
}

/* Футер с кнопкой */
.service-footer {
    padding: 8px 12px 12px;
    text-align: center;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(52, 152, 219, 0.1);
    flex-shrink: 0;
}

.service-footer .btn {
    background-color: var(--accent-color);
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    width: 100%;
    cursor: pointer;
}

.service-footer .btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.02);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .service-card {
        aspect-ratio: auto;
        min-height: auto;
    }

    .service-header {
        min-height: 60px;
        padding: 12px 10px;
    }

    .service-header h3 {
        font-size: 1rem;
    }

    .service-body,
    .service-price,
    .service-footer {
        width: 100%;
        min-width: 100%;
        margin: 0;
        text-align: left;
    }

    .service-price {
        border-left: none;
        border-right: none;
        border-top: 2px dashed rgba(52, 152, 219, 0.2);
        border-bottom: 2px dashed rgba(52, 152, 219, 0.2);
        padding: 10px 0;
        text-align: left;
    }

    .service-footer {
        text-align: left;
        padding: 10px 0;
    }
}

/* ===== СООБЩЕНИЯ ===== */
.messages {
    margin-bottom: 20px;
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1976d2;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    aside {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
    }

    .logo-header {
        flex-direction: row;
        text-align: left;
    }

    .logo-header img {
        margin-right: 15px;
        margin-bottom: 0;
        width: 60px;
        height: 60px;
    }

    aside nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    aside nav ul li {
        margin-bottom: 0;
    }

    aside nav ul li a {
        padding: 8px 15px;
    }

    main {
        margin-left: 0;
        max-width: 100%;
        padding: 25px;
    }

    .tables-container {
        flex-direction: column;
        gap: 20px;
    }

    .advantages {
        flex-direction: column;
        align-items: center;
    }

    .advantage-card {
        max-width: 100%;
    }
}

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

    .service-card {
        aspect-ratio: auto;
        min-height: auto;
    }

    .service-header,
    .service-body,
    .service-price,
    .service-footer {
        width: 100%;
        min-width: 100%;
        margin: 0;
        text-align: left;
    }

    .service-price {
        border-left: none;
        border-right: none;
        border-top: 2px dashed rgba(52, 152, 219, 0.2);
        border-bottom: 2px dashed rgba(52, 152, 219, 0.2);
        padding: 10px 0;
        text-align: left;
    }

    .service-footer {
        text-align: left;
    }
}