/* static/css/alenda.css */

/* ==========================================================================
   Alenda Custom Styles
   Поверх IDS, только необходимые переопределения и утилиты
   ========================================================================== */

/* ----------------------------------------
   Переменные
---------------------------------------- */
:root {
    /* Шрифт */
    --ids__font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Плотность верстки */
    --ids__density: 1.4;

    /* Fluid typography */
    --desktop-font-size-min: 18px;
    --desktop-font-size-max: 22px;
    --mobile-font-size-min: 16px;
    --mobile-font-size-max: 18px;

    /* Цветовая схема Alenda */
    --ids__text-RGB: 26, 32, 44;        /* #1a202c */
    --ids__link-RGB: 99, 102, 241;      /* #6366f1 */
    --ids__hover-RGB: 79, 70, 229;       /* #4f46e5 */
    --ids__accent-RGB: 124, 58, 237;     /* #7c3aed */
    --ids__surface-RGB: 255, 255, 255;   /* #ffffff */
    --ids__background-RGB: 249, 250, 251; /* #f9fafb */

    /* Радиус скругления */
    --ids__radius: 8px;
}

/* Дополнительные утилиты, которых нет в IDS */
.ids-flex {
    display: flex;
}

.ids-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ids-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ids-gap-1 { gap: 0.5rem; }
.ids-gap-2 { gap: 1rem; }
.ids-gap-3 { gap: 1.5rem; }
.ids-gap-4 { gap: 2rem; }

.ids-mt-1 { margin-top: 0.5rem; }
.ids-mt-2 { margin-top: 1rem; }
.ids-mt-3 { margin-top: 1.5rem; }
.ids-mt-4 { margin-top: 2rem; }

.ids-mb-1 { margin-bottom: 0.5rem; }
.ids-mb-2 { margin-bottom: 1rem; }
.ids-mb-3 { margin-bottom: 1.5rem; }
.ids-mb-4 { margin-bottom: 2rem; }

/* Анимации */
@keyframes ids-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   Базовые стили
---------------------------------------- */
html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: rgb(var(--ids__background-RGB));
    min-height: 100vh;
}

/* ----------------------------------------
   Основные контейнеры
---------------------------------------- */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Контейнер для узкого контента (формы, профиль) */
.content-container.narrow {
    max-width: 800px;
}

/* Обертка страницы для прижатого футера */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.page-content {
    flex: 1;
    width: 100%;
}

/* Убираем внутренние отступы у IDS врапперов */
.ids__wrapper,
.ids__wrapper.L,
.ids__wrapper.XL,
.ids__wrapper.XXL {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ----------------------------------------
   Типографика
---------------------------------------- */
h1, .h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
}

h2, .h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 1rem;
}

h3, .h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.75rem;
}

h4, .h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.text-muted {
    color: rgba(var(--ids__text-RGB), 0.6);
}

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

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.font-bold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

/* ----------------------------------------
   Кнопки
---------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--ids__radius);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    box-sizing: border-box;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: rgb(var(--ids__accent-RGB));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(var(--ids__accent-RGB), 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline {
    border: 1px solid rgba(var(--ids__text-RGB), 0.1);
    color: rgb(var(--ids__text-RGB));
    background: transparent;
}

.btn-outline:hover:not(:disabled) {
    background: rgba(var(--ids__text-RGB), 0.05);
    border-color: rgba(var(--ids__text-RGB), 0.2);
}

.btn-link {
    color: rgba(var(--ids__text-RGB), 0.6);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.btn-link:hover {
    color: rgb(var(--ids__accent-RGB));
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ----------------------------------------
   Карточки
---------------------------------------- */
.card {
    background: rgb(var(--ids__surface-RGB));
    border-radius: var(--ids__radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(var(--ids__text-RGB), 0.05);
}

.card.no-padding {
    padding: 0;
}

.card.no-shadow {
    box-shadow: none;
}

/* ----------------------------------------
   Формы
---------------------------------------- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(var(--ids__text-RGB), 0.7);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(var(--ids__text-RGB), 0.1);
    border-radius: var(--ids__radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: rgb(var(--ids__surface-RGB));
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: rgb(var(--ids__accent-RGB));
    box-shadow: 0 0 0 3px rgba(var(--ids__accent-RGB), 0.1);
}

.form-input.error {
    border-color: #e53e3e;
}

.form-input.error:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-error {
    font-size: 0.875rem;
    color: #e53e3e;
    margin-top: 0.25rem;
}

/* ----------------------------------------
   Алерты
---------------------------------------- */
.alert {
    padding: 1rem;
    border-radius: var(--ids__radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border: 1px solid #e53e3e;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: #2f855a;
    border: 1px solid #2f855a;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    color: #c05621;
    border: 1px solid #c05621;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: #2b6cb0;
    border: 1px solid #2b6cb0;
}

/* ----------------------------------------
   Спиннер
---------------------------------------- */
.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-lg {
    width: 2rem;
    height: 2rem;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----------------------------------------
   Статусы записей
---------------------------------------- */
.status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #cce5ff;
    color: #004085;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* ----------------------------------------
   Аватар
---------------------------------------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 120px;
    height: 120px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgb(var(--ids__accent-RGB));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.avatar-placeholder-lg {
    width: 120px;
    height: 120px;
    font-size: 3rem;
}

.avatar-placeholder-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

/* ----------------------------------------
   Дропдаун
---------------------------------------- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgb(var(--ids__surface-RGB));
    border-radius: var(--ids__radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid rgba(var(--ids__text-RGB), 0.1);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: rgb(var(--ids__text-RGB));
    transition: background 0.2s;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    box-sizing: border-box;
}

.dropdown-item:hover {
    background: rgba(var(--ids__background-RGB), 0.5);
}

.dropdown-item.danger {
    color: #e53e3e;
}

.dropdown-item.danger:hover {
    background: rgba(229, 62, 62, 0.1);
}

.divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid rgba(var(--ids__text-RGB), 0.1);
}

/* ----------------------------------------
   Сетки и Flex
---------------------------------------- */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-5 {
    gap: 1.25rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* ----------------------------------------
   Отступы
---------------------------------------- */
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

/* ----------------------------------------
   Прогресс шаги
---------------------------------------- */
.progress-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: rgba(var(--ids__text-RGB), 0.1);
    color: rgba(var(--ids__text-RGB), 0.3);
    transition: all 0.3s;
}

.progress-step.active {
    background: rgb(var(--ids__accent-RGB));
    color: white;
}

.progress-step.completed {
    background: rgb(var(--ids__accent-RGB));
    color: white;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: rgba(var(--ids__text-RGB), 0.1);
    transition: background 0.3s;
}

.progress-line.active {
    background: rgb(var(--ids__accent-RGB));
}

/* ----------------------------------------
   Хайлайт / Выделение
---------------------------------------- */
.highlight {
    background: rgba(var(--ids__accent-RGB), 0.1);
    padding: 1.5rem;
    border-radius: var(--ids__radius);
    border: 1px solid rgba(var(--ids__accent-RGB), 0.2);
}

/* ----------------------------------------
   Утилиты ширины
---------------------------------------- */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.h-full {
    height: 100%;
}

/* ----------------------------------------
   Медиа-запросы
---------------------------------------- */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .content-container {
        padding: 0 1rem;
    }

    h1,
    .h1 {
        font-size: 2rem;
    }

    h2,
    .h2 {
        font-size: 1.75rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    .progress-step {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .card {
        padding: 1rem;
    }

    .hide-mobile {
        display: none;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
}

/* ----------------------------------------
   Анимации
---------------------------------------- */
.fade-enter {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------------------------
   Календарь
---------------------------------------- */
.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-right: 1px solid rgba(var(--ids__text-RGB), 0.1);
    border-bottom: 1px solid rgba(var(--ids__text-RGB), 0.1);
    background: white;
}

.calendar-day.other-month {
    background: rgba(var(--ids__background-RGB), 0.5);
}

.calendar-day.today {
    background: rgba(var(--ids__accent-RGB), 0.05);
    border: 2px solid rgb(var(--ids__accent-RGB));
}

.calendar-event {
    display: block;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    background: rgba(var(--ids__accent-RGB), 0.9);
    color: white;
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event:hover {
    opacity: 0.9;
}

/* ----------------------------------------
   Разное
---------------------------------------- */
.clickable {
    cursor: pointer;
}

.no-select {
    user-select: none;
}

.overflow-hidden {
    overflow: hidden;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}