/* ========================================
   КАРТОЧКИ И СТАТИСТИКА
   ======================================== */

/* ========================================
   БАЗОВЫЕ СТИЛИ КАРТОЧЕК
   ======================================== */

.card {
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px !important;
}

/* ========================================
   КАРТОЧКИ БЫСТРОГО ДОБАВЛЕНИЯ (DASHBOARD)
   ======================================== */

.quick-add-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quick-add-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.quick-add-card .rounded-circle {
    transition: transform 0.3s ease;
}

.quick-add-card:hover .rounded-circle {
    transform: rotate(360deg) scale(1.1);
}

/* Hover эффекты для статистических карточек */
.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.stat-card:hover .rounded-circle {
    transform: rotate(360deg) scale(1.15);
}

.stat-card .rounded-circle {
    transition: transform 0.4s ease;
}

/* Дополнительные цветовые классы */
.text-purple {
    color: #9c27b0 !important;
}

.text-pink {
    color: #e91e63 !important;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ========================================
   СТАТИСТИЧЕСКИЕ КАРТОЧКИ
   ======================================== */

/* Базовые статистические карточки */
.card.statistics-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Дополнительные hover эффекты для statistics-card на странице импорта */
.statistics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Анимация для чисел в statistics-card */
.statistics-card .fs-4 {
    transition: transform 0.2s ease, color 0.2s ease;
}

.statistics-card:hover .fs-4 {
    color: #007bff !important;
}

/* ========================================
   УЛУЧШЕННЫЕ СТАТИСТИЧЕСКИЕ КАРТОЧКИ
   ======================================== */

/* Enhanced Statistics Cards Styles */
.stat-card {
    cursor: default;
    border-radius: 16px !important;
    overflow: hidden;
}

/* Статистические карточки с улучшенными эффектами */
.stat-card {
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow var(--transition-normal) ease;
    cursor: default;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-xl) !important;
}

/* Анимация бликов на карточках */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.stat-card:hover::before {
    left: 100%;
}

/* Pulse animation for numbers */
@keyframes pulse-number {
    0% { 
        transform: scale(1); 
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% { 
        transform: scale(1.08); 
        text-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    100% { 
        transform: scale(1); 
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* ========================================
   УНИВЕРСАЛЬНЫЙ КЛАСС ДЛЯ СЧЕТЧИКОВ СТАТИСТИКИ
   ======================================== */

/* Основной класс для всех числовых значений в статистических карточках */
.stat-number {
    font-size: 1.1rem !important;  /* Компактный размер для всех счетчиков */
    font-weight: 700 !important;
    line-height: 1.2 !important;
    transition: all var(--transition-normal) ease;
    position: relative;
    z-index: 2;
    color: inherit;
}

/* Анимация при hover для счетчиков */
.stat-card:hover .stat-number,
.statistics-card:hover .stat-number {
    animation: pulse-number 0.8s ease-in-out;
}

/* Responsive размеры для мобильных устройств */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1rem !important;  /* Ещё меньше на мобильных */
    }
}

.stat-card .fs-3 {
    transition: all var(--transition-normal) ease;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.stat-card .fs-4 {
    transition: all var(--transition-normal) ease;
    font-weight: 700;
    position: relative;
    z-index: 2;
    font-size: 1.1rem !important;  /* Меньший размер для более компактного вида */
}

.stat-card:hover .fs-3 {
    animation: pulse-number 0.8s ease-in-out;
}

.stat-card:hover .fs-4 {
    animation: pulse-number 0.8s ease-in-out;
}

/* Улучшенные анимации иконок */
.stat-card .rounded-circle {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.stat-card:hover .rounded-circle {
    transform: rotate(360deg) scale(1.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Shine effect для иконок */
.stat-card .rounded-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
    transition: all 0.6s ease;
    transform: translateX(-100%);
}

.stat-card:hover .rounded-circle::before {
    transform: translateX(100%);
}

/* Анимация для дополнительного текста */
.stat-card .small {
    transition: all var(--transition-normal) ease;
    position: relative;
    z-index: 2;
}

.stat-card:hover .small {
    transform: translateX(5px);
    opacity: 0.9;
}

/* ========================================
   СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ MANAGE_CLIENTS
   ======================================== */

/* Контейнер статистики с градиентным фоном */
.manage-clients-stats {
    background: linear-gradient(135deg, var(--bg-light) 0%, #e9ecef 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Анимация появления карточек по очереди */
@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Применяем анимацию к карточкам с задержкой */
.stat-card:nth-child(1) { animation: slideInFromBottom 0.6s ease 0.1s both; }
.stat-card:nth-child(2) { animation: slideInFromBottom 0.6s ease 0.2s both; }
.stat-card:nth-child(3) { animation: slideInFromBottom 0.6s ease 0.3s both; }
.stat-card:nth-child(4) { animation: slideInFromBottom 0.6s ease 0.4s both; }
.stat-card:nth-child(5) { animation: slideInFromBottom 0.6s ease 0.5s both; }
.stat-card:nth-child(6) { animation: slideInFromBottom 0.6s ease 0.6s both; }

/* Для второго ряда карточек */
.manage-clients-stats .row:nth-child(2) .stat-card:nth-child(1) { 
    animation: slideInFromBottom 0.6s ease 0.7s both; 
}
.manage-clients-stats .row:nth-child(2) .stat-card:nth-child(2) { 
    animation: slideInFromBottom 0.6s ease 0.8s both; 
}
.manage-clients-stats .row:nth-child(2) .stat-card:nth-child(3) { 
    animation: slideInFromBottom 0.6s ease 0.9s both; 
}

/* Floating effect для всего контейнера статистики */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.manage-clients-stats:hover {
    animation: float 3s ease-in-out infinite;
}

/* Градиентная рамка для выделения важных карточек */
.stat-card.highlight::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--success-color), var(--warning-color), var(--danger-color));
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.stat-card.highlight:hover::before {
    opacity: 1;
}

.client-sessions-page .statistics-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.client-sessions-page .card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.client-sessions-page .card-header h5 {
    margin-bottom: 0;
    font-weight: 600;
    color: #495057;
}

/* ========================================
   ФИЛЬТР КАРТОЧКИ
   ======================================== */

.filter-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.filter-card.active {
    border-color: #007bff;
    background-color: rgba(0,123,255,0.1);
}

/* ========================================
   ГРАДИЕНТЫ ДЛЯ КАРТОЧЕК
   ======================================== */

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Enhanced card headers */
.card-header.bg-gradient-primary {
    border: none;
    position: relative;
    overflow: hidden;
}

.card-header.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Gradient text effects */
.text-purple {
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   МОДУЛЬ СТАТИСТИКИ
   ======================================== */

/* Скрытие statistics module по умолчанию */
#statisticsModule {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#statisticsModule[style*="display: block"] {
    opacity: 1;
}

#statisticsModule .card:hover .card-body::before {
    opacity: 1;
}

/* ========================================
   АНИМАЦИИ ЗАГРУЗКИ
   ======================================== */

/* Loading animation for statistics */
.stat-loading {
    animation: stat-shimmer 1.5s ease-in-out infinite;
}

@keyframes stat-shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========================================
   АДАПТИВНЫЕ СТИЛИ ДЛЯ КАРТОЧЕК
   ======================================== */

/* Responsive text sizing */
@media (max-width: 768px) {
    .stat-card .fs-3 {
        font-size: 1.5rem !important;
    }
    
    .stat-card .rounded-circle {
        width: 48px !important;
        height: 48px !important;
    }
    
    .stat-card .fs-4 {
        font-size: 1rem !important;  /* Ещё меньше на мобильных */
    }
}

/* ========================================
   SEARCHABLE DROPDOWN СТИЛИ (КАНАЛЫ)
   ======================================== */

/* Стили для searchable dropdown */
.channel-item {
    cursor: pointer;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.channel-item:hover {
    background-color: #f8f9fa;
}

.channel-item:last-child {
    border-bottom: none;
}

.channel-item strong {
    color: #0d6efd;
    font-weight: 600;
}

.channel-item small {
    font-size: 0.85em;
}

#channelSearchInput:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#channelDropdownMenu {
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#channelDropdownButton {
    border: 2px solid #dee2e6;
    min-height: 38px;
}

#channelDropdownButton:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ========================================
   ПРОГРЕСС БАРЫ С АНИМАЦИЯМИ
   ======================================== */

/* Анимированные прогресс бары */
.progress-animated .progress-bar {
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

/* ========================================
   УДАЛЕНИЕ ТЕНЕЙ И ГРАНИЦ ДЛЯ ТАБЛИЦ В КАРТОЧКАХ
   ======================================== */

/* Убираем тени с карточек, содержащих таблицы */
.card:has(.table),
.card:has(.table-responsive) {
    box-shadow: none !important;
    border: none !important;
}

/* Убираем границы у элементов внутри карточек с таблицами */
.card .table-responsive,
.card .table {
    border: none !important;
    box-shadow: none !important;
}
