/* LinkedIn Advent Calendar Dashboard Design System */

/* Основные стили */
* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Корпоративные стили для графиков */
.recharts-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Оси и сетка */
.recharts-cartesian-axis-tick-value {
    font-size: 12px !important;
    fill: #000000 !important;
    font-weight: normal !important;
}

.recharts-cartesian-axis-tick-line {
    stroke: #000000;
    stroke-width: 1;
}

.recharts-cartesian-axis-line {
    stroke: #000000;
    stroke-width: 1;
}

/* Скрыть линию оси Y для всех графиков */
.recharts-cartesian-axis-y .recharts-cartesian-axis-line {
    display: none !important;
}

/* Дополнительные селекторы для скрытия линий оси Y */
.recharts-cartesian-axis-y line {
    display: none !important;
}

.recharts-cartesian-axis-y .recharts-cartesian-axis-line {
    stroke: transparent !important;
    display: none !important;
}

/* Центрирование лейблов осей Y */
.recharts-cartesian-axis-y .recharts-cartesian-axis-tick-value {
    text-anchor: middle !important;
    dominant-baseline: middle !important;
    font-size: 12px !important;
    fill: #000000 !important;
    font-weight: normal !important;
}

/* Исправление позиционирования верхнего лейбла */
.recharts-cartesian-axis-y .recharts-cartesian-axis-tick-value:last-child {
    transform: translateY(-2px) !important;
}

/* Альтернативный подход - через селектор по позиции */
.recharts-cartesian-axis-y .recharts-cartesian-axis-tick-value[data-value] {
    transform: translateY(0px) !important;
}

/* Убрать отступы графиков */
.recharts-wrapper {
    margin-left: 25px !important;
    padding-left: 0 !important;
    transform: translateX(-15%) !important;
}

.recharts-surface {
    margin-left: 25px !important;
    padding-left: 0 !important;
}

.recharts-cartesian-axis {
    margin-left: 25px !important;
    padding-left: 0 !important;
}

/* Графики в ряд без отступов */
.chart-inline .recharts-wrapper,
.chart-inline .recharts-surface,
.chart-inline .recharts-cartesian-axis {
    margin-left: 0 !important;
    padding-left: 0 !important;
    transform: none !important;
}


.recharts-cartesian-grid-horizontal line {
    stroke: #f9fafb;
    stroke-width: 1;
}

.recharts-cartesian-grid-vertical line {
    stroke: #f9fafb;
    stroke-width: 1;
}

/* Линии графиков */
.recharts-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recharts-bar {
    stroke-width: 0;
}

/* Корпоративные цвета для данных */
.recharts-line[stroke="#10b981"] {
    stroke: #4caf50; /* data_categories.positive */
}

.recharts-line[stroke="#ec4899"] {
    stroke: #e91e63; /* data_categories.negative */
}

.recharts-bar[fill="#3b82f6"] {
    fill: #03a9f4; /* data_categories.neutral */
}

.recharts-bar[fill="#f59e0b"] {
    fill: #673ab7; /* data_categories.suspended */
}

/* Стили для точек данных */
.recharts-dot {
    stroke-width: 0;
}

/* Корпоративные компоненты */
.chart-container {
    background: #ffffff;
    border: 0;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.25rem;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #4b5563;
    font-weight: 400;
    margin-bottom: 1.5rem;
    line-height: 1.625;
}

/* Заголовки графиков */
.chart-title-small {
    font-size: 1rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.5rem;
}

/* Стили для адвент-календаря */
.advent-card {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    mix-blend-mode: normal;
}

.advent-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.advent-card.closed {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid #0077B5; /* Border по центру края (половина внутри, половина снаружи) */
    box-sizing: border-box; /* Border включается в размер для точного совпадения с маской */
    position: relative;
    overflow: hidden; /* Обрезаем фоновую картинку по границам плитки */
}

/* У неактивных плиток фоновая картинка видна через общую маску */
/* У активных плиток фоновая картинка скрыта белым фоном */

.advent-card.open {
    background: #ffffff !important; /* Белый фон - под активными плитками нет фоновой картинки */
    border: none !important; /* Убираем границу для открытых плиток */
    outline: none !important;
    position: relative;
    z-index: 3; /* Выше неактивных плиток для надежности */
}

/* Убираем фоновую картинку под активными плитками полностью */
.advent-card.open::before,
.advent-card.open::after {
    display: none !important;
    content: none !important;
    background-image: none !important;
}

.advent-card.open .advent-card-image {
    opacity: 1; /* Убираем синюю тонировку */
    position: relative;
    z-index: 1;
}

.advent-card.open .advent-card-number {
    background: #0077B5 !important;
    color: #ffffff !important;
    border-color: #0077B5 !important;
    z-index: 2;
    transition: opacity 0.2s;
}

/* При hover на активную плитку - скрываем номер и затемняем картинку */
.advent-card.open:hover .advent-card-number {
    opacity: 0;
}

.advent-card.open:hover .advent-card-image {
    filter: brightness(0.4); /* Затемняем картинку через brightness, без изменения opacity */
}


/* Фоновая картинка растягивается на все плитки через маску */
.calendar-grid-with-logo {
    position: relative;
}

.calendar-grid-with-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--logo-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    /* Маска показывает картинку только внутри всех плиток (и активных, и неактивных) */
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cmask id='grid-mask'%3E%3Crect width='100' height='100' fill='black'/%3E%3Crect x='0' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100' height='100' fill='white' mask='url(%23grid-mask)'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cmask id='grid-mask'%3E%3Crect width='100' height='100' fill='black'/%3E%3Crect x='0' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='0' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='25.5144' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='51.0288' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='0' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='25.5144' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='51.0288' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3Crect x='76.5432' y='76.5432' width='23.4568' height='23.4568' rx='2.5' ry='2.5' fill='white'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100' height='100' fill='white' mask='url(%23grid-mask)'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
}


.advent-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Убираем возможные отступы у img */
    margin: 0;
    padding: 0;
    border: none;
    outline: none; /* Убираем outline при фокусе */
}

.advent-card-number {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #0077B5;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    z-index: 10;
}

/* Прогресс-бар */
.progress-bar-container {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: #03a9f4;
    border-radius: 0.25rem;
    transition: width 0.3s ease;
}

/* Вертикальный прогресс-бар */
.progress-bar-vertical {
    width: 0.5rem;
    height: 100%;
    background: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    min-height: 2.5rem;
}

.progress-bar-fill-vertical {
    width: 100%;
    background: #03a9f4;
    border-radius: 0.25rem;
    transition: height 0.3s ease;
}

/* Tooltip для карточек - только для активных плиток */
.advent-card.open .advent-tooltip {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    padding: 0;
    border-radius: 0;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
    text-align: left;
    line-height: 1.2; /* Меньший интерлиньяж между словом и цифрой */
    margin-top: -0.2rem; /* Отступ сверху */
    margin-bottom: -0.5rem; /* Отступ снизу */
}

.advent-card.open:hover .advent-tooltip {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 640px) {
    .chart-title {
        font-size: 1.25rem;
    }
    
    .chart-subtitle {
        font-size: 0.75rem;
    }
    
    .recharts-cartesian-axis-tick-value {
        font-size: 12px !important;
    }
}

