/*
   Activity Tracker Styles - Стили блока трекера активности
   Файл: assets/css/main/activity-tracker.css
*/

/* ========== ОСНОВНОЙ БЛОК ========== */
.tracker-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.dark-theme .tracker-card {
    background: rgba(30, 30, 46, 0.9);
}

/* Градиентная рамка */
.tracker-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.dark-theme .tracker-card::before {
    opacity: 0.7;
}

.tracker-card > * {
    position: relative;
    z-index: 1;
}

/* ========== ЛЕЙАУТ ========== */
.tracker-layout {
    display: flex;
    gap: 16px;
}

.tracker-left {
    flex: 1;
    min-width: 0;
}

.tracker-achievements-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

/* ========== ЗАГОЛОВОК ========== */
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.tracker-title {
    font-size: 1em;
    font-weight: 700;
    color: #1e293b;
}

.dark-theme .tracker-title {
    color: #ffffff;
}

/* ========== КНОПКА ИНФОРМАЦИИ ========== */
.tracker-info-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-size: 0.9em;
    font-style: normal;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.tracker-info-button:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.1);
}

.tracker-info-button:active {
    transform: scale(0.95);
}

.tracker-info-button:focus {
    outline: none;
}

.dark-theme .tracker-info-button {
    background: rgba(255, 255, 255, 0.1);
    color: #c4b5fd;
}

.dark-theme .tracker-info-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ddd6fe;
}

/* ========== ИНФОРМАЦИОННАЯ ПАНЕЛЬ ========== */
.tracker-info-panel {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.12);
    animation: trackerInfoSlide 0.3s ease;
}

.dark-theme .tracker-info-panel {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

.tracker-info-panel.hidden {
    display: none;
}

.tracker-info-content p {
    font-size: 0.7em;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 6px 0;
}

.tracker-info-content p:last-child {
    margin-bottom: 0;
}

.dark-theme .tracker-info-content p {
    color: #94a3b8;
}

.tracker-info-note {
    color: #8b5cf6 !important;
    font-weight: 600;
    margin-top: 8px !important;
    padding-top: 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.dark-theme .tracker-info-note {
    color: #c4b5fd !important;
}

@keyframes trackerInfoSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== КАЛЕНДАРЬ ========== */
.tracker-calendar-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.tracker-calendar-wrapper .slider-btn {
    font-size: 1.5em;
    padding: 0;
    flex-shrink: 0;
}

.tracker-calendar-container {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.tracker-month-label {
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.dark-theme .tracker-month-label {
    color: #ffffff;
}

.tracker-calendar {
    width: 100%;
}

.tracker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}

.tracker-weekdays span {
    font-size: 0.65em;
    font-weight: 600;
    color: #94a3b8;
}

.dark-theme .tracker-weekdays span {
    color: #64748b;
}

.tracker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

/* ========== ЯЧЕЙКА ДНЯ ========== */
.tracker-day {
    aspect-ratio: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    border-radius: 9px;
    color: #1e293b;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-theme .tracker-day {
    color: #e2e8f0;
}

.tracker-day:hover {
    transform: scale(1.1);
}

.tracker-day.empty {
    cursor: default;
}

.tracker-day.empty:hover {
    transform: none;
}

/* Текущий день */
.tracker-day.today {
    border: 2px solid #8b5cf6;
    font-weight: 700;
}

.dark-theme .tracker-day.today {
    border-color: #a78bfa;
}

/* Фон в сегодняшнем дне — без отступа, радиус = cell(9px) - border(2px) = 7px */
.tracker-day.today .tracker-day-bg {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 7px;
}

/* Номер дня поверх фона */
.tracker-day-number {
    position: relative;
    z-index: 2;
    line-height: 1;
}

/* Фон активностей — с отступом 1px от края ячейки */
.tracker-day-bg {
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
}

.tracker-day-bg-section {
    flex: 1;
}

/* Цвета активностей */
.tracker-bg-exercise {
    background: rgba(177, 147, 245, 0.8);
}

.tracker-bg-workout {
    background: rgba(245, 110, 177, 0.8);
}

.dark-theme .tracker-bg-exercise {
    background: rgba(177, 147, 245, 0.9);
}

.dark-theme .tracker-bg-workout {
    background: rgba(245, 110, 177, 0.9);
}

/* ========== ЛЕГЕНДА + СЧЁТЧИК ========== */
.tracker-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tracker-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tracker-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tracker-legend-text {
    font-size: 0.65em;
    color: #64748b;
}

.dark-theme .tracker-legend-text {
    color: #94a3b8;
}

.tracker-legend .tracker-counter-value {
    font-size: 0.65em;
    font-weight: 700;
    color: #1e293b;
}

.dark-theme .tracker-legend .tracker-counter-value {
    color: #ffffff;
}

/* ========== ФИЛЬТР ========== */
.tracker-filter {
    margin-bottom: 0;
}

.tracker-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tracker-filter-btn {
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
    color: #64748b;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.65em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.tracker-filter-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.tracker-filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: transparent;
}

.dark-theme .tracker-filter-btn {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: #94a3b8;
}

.dark-theme .tracker-filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

/* Выбор месяцев */
.tracker-month-selector {
    margin-top: 8px;
}

.tracker-month-carousel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracker-carousel-arrow {
    border: none;
    background: none;
    color: #64748b;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.dark-theme .tracker-carousel-arrow {
    color: #94a3b8;
}

.tracker-carousel-arrow:hover {
    transform: scale(1.2);
}

.tracker-carousel-months {
    display: flex;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
}

.tracker-carousel-month {
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
    color: #64748b;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.6em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tracker-carousel-month:hover {
    background: rgba(139, 92, 246, 0.1);
}

.tracker-carousel-month.selected {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: transparent;
}

.dark-theme .tracker-carousel-month {
    border-color: rgba(139, 92, 246, 0.3);
    color: #94a3b8;
}

.dark-theme .tracker-carousel-month.selected {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.tracker-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.tracker-carousel-month.selected .tracker-carousel-dot {
    opacity: 1;
}

/* ========== ИКОНКИ СЧЁТЧИКА ========== */
.tracker-icon-total {
    background: linear-gradient(135deg, rgb(177, 147, 245), rgb(245, 110, 177));
}

/* ========== ДОСТИЖЕНИЯ (правая часть) ========== */
.tracker-achievement-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.tracker-achievement-label {
    font-size: 0.65em;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
}

.dark-theme .tracker-achievement-label {
    color: #64748b;
}

.tracker-achievement {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.1);
    padding: 4px 3px;
    transition: all 0.3s ease;
    min-height: 80px;
}

.dark-theme .tracker-achievement {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.15);
}

.tracker-achievement-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.tracker-achievement-icon {
    font-size: 1.5em;
    opacity: 0.3;
}

.tracker-achievement-hint {
    font-size: 0.6em;
    color: #94a3b8;
    opacity: 0.6;
}

.dark-theme .tracker-achievement-hint {
    color: #64748b;
}

/* Достижение разблокировано */
.tracker-achievement.unlocked {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
    animation: achievementGlow 3s ease-in-out infinite;
}

.dark-theme .tracker-achievement.unlocked {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
    border-color: rgba(139, 92, 246, 0.4);
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(139, 92, 246, 0.15); }
}

.tracker-achievement-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-align: center;
}

.tracker-achievement-image {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    object-fit: cover;
}

.tracker-achievement-rank {
    font-size: 0.7em;
    font-weight: 700;
    color: #8b5cf6;
    line-height: 1.2;
}

.dark-theme .tracker-achievement-rank {
    color: #a78bfa;
}

.tracker-achievement-next {
    font-size: 0.55em;
    color: #94a3b8;
    margin-top: 2px;
}

.dark-theme .tracker-achievement-next {
    color: #64748b;
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.tracker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.tracker-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.tracker-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 24px;
    max-width: 90%;
    width: 360px;
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

.dark-theme .tracker-modal-content {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: white;
}

.tracker-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.dark-theme .tracker-modal-header {
    border-bottom-color: rgba(58, 58, 94, 0.5);
}

.tracker-modal-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.dark-theme .tracker-modal-title {
    color: white;
}

.tracker-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #64748b;
    transition: color 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tracker-modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Поле даты */
.tracker-modal-date-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tracker-modal-label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 600;
}

.dark-theme .tracker-modal-label {
    color: #b3b3cc;
}

.tracker-date-input {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 1em;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    caret-color: #1e293b;
    width: 100px;
    text-align: center;
    transition: all 0.3s ease;
}

.tracker-date-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.dark-theme .tracker-date-input {
    background: rgba(42, 42, 62, 0.9);
    color: #ffffff;
    caret-color: #ffffff;
    border-color: rgba(139, 92, 246, 0.4);
}

/* Активности */
.tracker-modal-activities {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tracker-activity-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(248, 250, 252, 0.5);
}

.dark-theme .tracker-activity-option {
    background: rgba(42, 42, 62, 0.5);
}

.tracker-activity-option:hover {
    background: rgba(139, 92, 246, 0.05);
}

.tracker-activity-option.checked {
    background: rgba(139, 92, 246, 0.1);
}

.dark-theme .tracker-activity-option.checked {
    background: rgba(139, 92, 246, 0.2);
}

.tracker-activity-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 0.75em;
}

.dark-theme .tracker-activity-check {
    border-color: #475569;
}

.tracker-activity-option.checked .tracker-activity-check {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.tracker-activity-option.checked .tracker-activity-check::after {
    content: '\2713';
}

.tracker-activity-option[data-activity="e"].checked .tracker-activity-check {
    background: rgb(177, 147, 245);
    border-color: rgb(177, 147, 245);
}

.tracker-activity-option[data-activity="w"].checked .tracker-activity-check {
    background: rgb(245, 110, 177);
    border-color: rgb(245, 110, 177);
}

.tracker-activity-label {
    font-size: 0.9em;
    color: #1e293b;
}

.dark-theme .tracker-activity-label {
    color: #e2e8f0;
}

/* Кнопка сохранить */
.tracker-modal-save {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tracker-modal-save:hover {
    transform: translateY(-1px);
}

.tracker-modal-save:active {
    transform: scale(0.98);
}

/* ========== МОДАЛКА ДОСТИЖЕНИЯ ========== */
.tracker-celebrate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

.tracker-celebrate-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalSlideUp 0.4s ease;
}

.dark-theme .tracker-celebrate-content {
    background: rgba(30, 30, 46, 0.95);
}

.tracker-celebrate-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #64748b;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dark-theme .tracker-celebrate-close {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.tracker-celebrate-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: scale(1.1);
}

.tracker-celebrate-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #8b5cf6;
    margin-bottom: 4px;
}

.dark-theme .tracker-celebrate-title {
    color: #a78bfa;
}

.tracker-celebrate-icon {
    font-size: 3em;
    margin-bottom: 10px;
    animation: celebrateBounce 0.8s ease;
}

.tracker-celebrate-image {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 8px;
}

.tracker-celebrate-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #1e293b;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.dark-theme .tracker-celebrate-text {
    color: #ffffff;
}

.tracker-celebrate-rank {
    font-size: 0.85em;
    font-weight: 700;
    color: #8b5cf6;
}

.dark-theme .tracker-celebrate-rank {
    color: #a78bfa;
}

@keyframes celebrateBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}

/* ========== АНИМАЦИИ ========== */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 480px) {
    .tracker-card {
        padding: 16px;
        margin-bottom: 16px;
    }

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

    .tracker-title {
        font-size: 0.95em;
    }

    .tracker-calendar-wrapper .slider-btn {
        font-size: 1.3em;
    }

    .tracker-day {
        font-size: 0.65em;
    }

    .tracker-achievement {
        min-height: 70px;
    }

    .tracker-achievement-image {
        width: 60px;
        height: 60px;
    }

    .tracker-celebrate-content {
        padding: 25px;
    }

    .tracker-celebrate-icon {
        font-size: 2.5em;
    }

    .tracker-celebrate-text {
        font-size: 1em;
    }

    .tracker-celebrate-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 320px) {
    .tracker-card {
        padding: 14px;
        border-radius: 16px;
    }

    .tracker-day {
        font-size: 0.6em;
    }

    .tracker-filter-btn {
        font-size: 0.6em;
        padding: 3px 6px;
    }
}
