/* Animation for bouncing */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Animation for new tickets - более мягкая и деликатная */
@keyframes newTicketPulse {
    0% { 
        background-color: rgba(79, 70, 229, 0.03);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.2);
    }
    50% { 
        background-color: rgba(79, 70, 229, 0.06);
        box-shadow: 0 0 0 2px rgba(79, 70, 229, 0);
    }
    100% { 
        background-color: rgba(79, 70, 229, 0.03);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

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

/* Плавное появление новых карточек при инкрементальном обновлении */
.ticket-card-inserting {
    animation: slideInFromTop 0.6s ease-out;
}

.ticket-row-new {
    animation: newTicketPulse 3s ease-in-out 2, slideInFromTop 0.6s ease-out;
    border-left: 3px solid #818cf8 !important;
}

body.dark-theme .ticket-row-new {
    animation: newTicketPulse 3s ease-in-out 2, slideInFromTop 0.6s ease-out;
    border-left: 3px solid #a5b4fc !important;
}

:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary-color: #10b981; /* Emerald 500 */
    --background-color: #f8fafc; /* Slate 50 */
    --card-background: #ffffff;
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --header-bg: rgba(255, 255, 255, 0.8);
    --dropdown-bg: #ffffff;
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --stat-card-bg: #ffffff;
}

/* Темная тема - улучшенная версия */
body.dark-theme {
    --primary-color: #818cf8; /* Indigo 400 - ярче для темной темы */
    --primary-hover: #6366f1; /* Indigo 500 */
    --secondary-color: #34d399; /* Emerald 400 */
    --background-color: #0f172a; /* Slate 900 */
    --card-background: #1e293b; /* Slate 800 */
    --text-primary: #f1f5f9; /* Slate 100 */
    --text-secondary: #cbd5e1; /* Slate 300 - светлее для лучшей читаемости */
    --border-color: #475569; /* Slate 600 - светлее */
    --header-bg: rgba(30, 41, 59, 0.95);
    --dropdown-bg: #1e293b;
    --input-bg: #334155;
    --modal-bg: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --stat-card-bg: #334155; /* Slate 700 - светлее для контраста */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Prevent flash of unstyled content */
    visibility: visible;
}

/* Smooth page load - prevent flashing */
header, #main-content {
    transition: opacity 0.4s ease-in-out;
    will-change: opacity;
}

header.loaded, #main-content.loaded {
    opacity: 1 !important;
}

/* Initial state for smooth appearance */
#app {
    background-color: var(--background-color);
}

/* IT-themed auth loading animation */
.auth-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.auth-loader__badge {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.auth-loader__grid {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(16, 185, 129, 0.12));
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.2);
    overflow: hidden;
}

.auth-loader__grid::before {
    content: '';
    position: absolute;
    inset: 16px;
    border: 1px dashed rgba(79, 70, 229, 0.35);
    border-radius: 16px;
    animation: auth-grid-pulse 2.4s ease-in-out infinite;
}

.auth-loader__grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.08) 1px, transparent 1px, transparent 12px),
        repeating-linear-gradient(0deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.08) 1px, transparent 1px, transparent 12px);
    animation: auth-grid-scan 3.2s linear infinite;
    opacity: 0.8;
}

.auth-loader__node {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.9);
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.6);
    animation: auth-node-glow 1.8s ease-in-out infinite;
}

.auth-loader__node:nth-child(1) {
    top: 22px;
    left: 26px;
    animation-delay: 0s;
}

.auth-loader__node:nth-child(2) {
    top: 28px;
    right: 30px;
    animation-delay: 0.4s;
}

.auth-loader__node:nth-child(3) {
    bottom: 30px;
    left: 34px;
    animation-delay: 0.8s;
}

.auth-loader__node:nth-child(4) {
    bottom: 26px;
    right: 28px;
    animation-delay: 1.2s;
}

.auth-loader__pulse {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.8);
    transform: translate(-50%, -50%);
    animation: auth-pulse 2.2s ease-out infinite;
}

.auth-loader__code {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.auth-loader__text {
    color: var(--text-secondary);
}

@keyframes auth-grid-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes auth-grid-scan {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-12px);
    }
}

@keyframes auth-node-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes auth-pulse {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.6);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(5);
        box-shadow: 0 0 0 24px rgba(16, 185, 129, 0);
    }
    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-loader__grid::before,
    .auth-loader__grid::after,
    .auth-loader__node,
    .auth-loader__pulse {
        animation: none;
    }
}

/* Адаптация основных элементов для темной темы */
body.dark-theme header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme .bg-white {
    background-color: var(--card-background) !important;
}

body.dark-theme .bg-slate-50,
body.dark-theme .bg-slate-100 {
    background-color: var(--stat-card-bg) !important;
}

body.dark-theme .bg-gray-50,
body.dark-theme .bg-gray-100 {
    background-color: var(--stat-card-bg) !important;
}

body.dark-theme .text-slate-800,
body.dark-theme .text-slate-900 {
    color: var(--text-primary) !important;
}

body.dark-theme .text-slate-600,
body.dark-theme .text-slate-500 {
    color: var(--text-secondary) !important;
}

body.dark-theme .text-slate-700 {
    color: #e2e8f0 !important;
}

body.dark-theme .text-slate-400 {
    color: #94a3b8 !important;
}

body.dark-theme .border-slate-200,
body.dark-theme .border-slate-300 {
    border-color: var(--border-color) !important;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #94a3b8;
}

body.dark-theme .shadow,
body.dark-theme .shadow-sm,
body.dark-theme .shadow-md,
body.dark-theme .shadow-lg,
body.dark-theme .shadow-xl {
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px var(--shadow-color);
}

body.dark-theme .dropdown-menu,
body.dark-theme [id*="dropdown"] {
    background-color: var(--dropdown-bg);
    border-color: var(--border-color);
}

body.dark-theme .hover\:bg-slate-100:hover,
body.dark-theme .hover\:bg-gray-100:hover {
    background-color: #475569 !important;
}

body.dark-theme .hover\:bg-indigo-50:hover {
    background-color: #4338ca !important;
}

/* Улучшенные фоновые цвета для темной темы */
body.dark-theme .bg-blue-50 {
    background-color: #1e3a8a !important;
}

body.dark-theme .bg-green-50 {
    background-color: #065f46 !important;
}

body.dark-theme .bg-yellow-50,
body.dark-theme .bg-amber-50 {
    background-color: #78350f !important;
}

body.dark-theme .bg-red-50 {
    background-color: #7f1d1d !important;
}

body.dark-theme .bg-indigo-50 {
    background-color: #3730a3 !important;
}

body.dark-theme .bg-purple-50 {
    background-color: #581c87 !important;
}

body.dark-theme .bg-indigo-100 {
    background-color: #4338ca !important;
}

body.dark-theme .bg-blue-100 {
    background-color: #1e40af !important;
}

body.dark-theme .bg-slate-200 {
    background-color: #475569 !important;
}

/* Улучшение текстовых цветов */
body.dark-theme .text-indigo-600 {
    color: #a5b4fc !important;
}

body.dark-theme .text-blue-600 {
    color: #93c5fd !important;
}

body.dark-theme .text-green-600 {
    color: #86efac !important;
}

body.dark-theme .text-red-600 {
    color: #fca5a5 !important;
}

body.dark-theme .text-yellow-600,
body.dark-theme .text-amber-600 {
    color: #fcd34d !important;
}

body.dark-theme .text-indigo-700 {
    color: #c7d2fe !important;
}

body.dark-theme .text-blue-700 {
    color: #bfdbfe !important;
}

body.dark-theme .text-blue-800 {
    color: #dbeafe !important;
}

/* Карточки статистики */
body.dark-theme .stat-card {
    background-color: var(--stat-card-bg);
    border: 1px solid var(--border-color);
}

/* Улучшение кнопок в темной теме */
body.dark-theme button:not(.bg-indigo-500):not(.bg-red-500):not(.bg-blue-500):not(.bg-green-500) {
    border-color: var(--border-color);
}

body.dark-theme .hover\:bg-red-200:hover {
    background-color: #991b1b !important;
}

body.dark-theme .hover\:bg-blue-300:hover {
    background-color: #1e40af !important;
}

body.dark-theme .hover\:bg-slate-300:hover {
    background-color: #64748b !important;
}

/* Модальные окна */
body.dark-theme .modal-content,
body.dark-theme [role="dialog"] {
    background-color: var(--card-background);
}

/* Улучшение читаемости badge элементов */
body.dark-theme .bg-green-100 {
    background-color: #065f46 !important;
    color: #86efac !important;
}

body.dark-theme .bg-red-100 {
    background-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

body.dark-theme .bg-orange-100 {
    background-color: #7c2d12 !important;
    color: #fdba74 !important;
}

body.dark-theme .text-green-700 {
    color: #86efac !important;
}

body.dark-theme .text-red-700 {
    color: #fca5a5 !important;
}

/* Улучшение форм */
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    border-color: var(--primary-color);
    background-color: #475569;
}

/* Таблицы */
body.dark-theme table thead {
    background-color: var(--stat-card-bg);
}

body.dark-theme table tbody tr {
    border-color: var(--border-color);
}

body.dark-theme table tbody tr:hover {
    background-color: var(--stat-card-bg);
}

/* Основной контент */
body.dark-theme #app,
body.dark-theme #main-content,
body.dark-theme .container {
    background-color: var(--background-color);
}

/* Убираем белый фон у div контейнеров */
body.dark-theme div:not([class*="bg-"]):not([style*="background"]) {
    background-color: transparent;
}

/* Важные контейнеры */
body.dark-theme .max-w-7xl,
body.dark-theme .min-h-screen {
    background-color: transparent;
}

/* Кнопка переключения темы */
#theme-toggle {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

#theme-toggle i.fa-moon,
#theme-toggle i.fa-sun {
    transition: opacity 0.3s ease;
}

/* В светлой теме показываем луну */
body:not(.dark-theme) #theme-toggle i.fa-moon {
    display: inline-block;
}

body:not(.dark-theme) #theme-toggle i.fa-sun {
    display: none !important;
}

/* В темной теме показываем солнце */
body.dark-theme #theme-toggle i.fa-moon {
    display: none !important;
}

body.dark-theme #theme-toggle i.fa-sun {
    display: inline-block !important;
    color: #fbbf24 !important;
}

body.dark-theme #theme-toggle:hover i.fa-sun {
    color: #fcd34d !important;
}

/* Улучшение видимости иконок в header в темной теме */
body.dark-theme header button:not(#theme-toggle) {
    color: #cbd5e1 !important;
}

body.dark-theme header button:not(#theme-toggle):hover {
    color: #a5b4fc !important;
}
/* Анимация появления */
.fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Стили для статусов */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.6rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.7rem;
    border: 1px solid;
}
.priority-низкий { background-color: #e0f2fe; color: #0284c7; border-color: #bae6fd; } /* sky-100, sky-600, sky-200 */
.priority-средний { background-color: #d9f99d; color: #65a30d; border-color: #bef264; } /* lime-200, lime-600, lime-300 */
.priority-высокий { background-color: #fed7aa; color: #ea580c; border-color: #fdba74; } /* orange-200, orange-600, orange-300 */

/* Icon Select Styles */
.icon-select {
    font-family: 'Font Awesome 5 Free', 'Inter', sans-serif;
}

.icon-select option {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
}

/* Improve select appearance */
select.border.rounded-lg {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.priority-критический { background-color: #fecaca; color: #dc2626; border-color: #fca5a5; } /* red-200, red-600, red-300 */

/* Интерактивные звезды рейтинга */
.rating-stars .fa-star {
    color: #cbd5e1; /* Slate 300 */
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.rating-stars:hover .fa-star {
    color: #f59e0b; /* Amber 500 */
}
.rating-stars .fa-star:hover ~ .fa-star {
    color: #cbd5e1;
}
.rating-stars .fa-star:hover {
    transform: scale(1.2);
}
.rating-stars .rated, .rating-stars .selected {
     color: #f59e0b;
}

/* Улучшенные кнопки */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Стили для карточек */
.ticket-card, .stat-card, .admin-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Легка підсвітка при наведенні */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

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

/* Підсвітка активної карточки */
.stat-card.active, .admin-card.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(129, 140, 248, 0.12) 100%);
    border: 2px solid rgba(79, 70, 229, 0.3);
    box-shadow: 
        0 0 0 3px rgba(79, 70, 229, 0.1),
        0 10px 25px -5px rgba(79, 70, 229, 0.2),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Пульсуюча рамка для активної карточки */
.stat-card.active::after, .admin-card.active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, 
        rgba(79, 70, 229, 0.4), 
        rgba(129, 140, 248, 0.4),
        rgba(79, 70, 229, 0.4)
    );
    z-index: -1;
    opacity: 0.6;
    filter: blur(8px);
    animation: activeGlow 2s ease-in-out infinite;
}

@keyframes activeGlow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* Темна тема для активної карточки */
body.dark-theme .stat-card.active, 
body.dark-theme .admin-card.active {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(165, 180, 252, 0.2) 100%);
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 
        0 0 0 3px rgba(129, 140, 248, 0.2),
        0 10px 25px -5px rgba(129, 140, 248, 0.3),
        0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.ticket-card:hover, .admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(79, 70, 229, 0.3), 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.stat-card:active {
    transform: translateY(-4px) scale(0.98);
    transition: all 0.1s ease;
}

/* Анімація для іконок в stat-card */
.stat-card-icon-bg {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stat-card:hover .stat-card-icon-bg {
    transform: rotate(8deg) scale(1.15);
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.4);
}

.stat-card .stat-card-icon-bg i {
    transition: all 0.3s ease;
}

.stat-card:hover .stat-card-icon-bg i {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.15) rotate(-3deg); }
}

/* Градієнтні фони для іконок */
.stat-card .bg-blue-100 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-card .bg-orange-100 {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
}

.stat-card .bg-yellow-100 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stat-card .bg-green-100 {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.stat-card .bg-cyan-100 {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
}

.stat-card .bg-purple-100 {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
}

/* Пульсація для нових даних */
@keyframes statPulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.stat-card.stat-updated {
    animation: statPulse 1s ease-out;
}

/* Анімація появи карток */
@keyframes statCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card {
    animation: statCardFadeIn 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

/* Анімація лічильників */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card p.text-3xl {
    animation: countUp 0.5s ease-out;
}

.drop-zone-active {
    border-color: var(--primary-color);
    background-color: #eef2ff; /* Indigo 50 */
}

.stat-card-active {
    box-shadow: 0 0 0 3px var(--primary-color), 0 20px 30px -10px rgba(79, 70, 229, 0.4);
    transform: translateY(-8px) scale(1.02);
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

/* Темна тема для stat-card */
body.dark-theme .stat-card-active {
    background: linear-gradient(135deg, var(--card-background) 0%, #312e81 100%);
    box-shadow: 0 0 0 3px var(--primary-color), 0 20px 30px -10px rgba(129, 140, 248, 0.4);
}

body.dark-theme .stat-card:hover {
    box-shadow: 0 20px 30px -10px rgba(129, 140, 248, 0.3), 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

body.dark-theme .stat-card .bg-blue-100 {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

body.dark-theme .stat-card .bg-orange-100 {
    background: linear-gradient(135deg, #7c2d12 0%, #9a3412 100%);
}

body.dark-theme .stat-card .bg-yellow-100 {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

body.dark-theme .stat-card .bg-green-100 {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

body.dark-theme .stat-card .bg-cyan-100 {
    background: linear-gradient(135deg, #164e63 0%, #155e75 100%);
}

body.dark-theme .stat-card .bg-purple-100 {
    background: linear-gradient(135deg, #581c87 0%, #6b21a8 100%);
}

/* Покращені ефекти для admin-card */
.admin-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -15px rgba(79, 70, 229, 0.35);
    border-color: rgba(79, 70, 229, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.admin-card i {
    transition: all 0.4s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.admin-card:hover i {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.15));
}

body.dark-theme .admin-card {
    background: linear-gradient(135deg, var(--card-background) 0%, #1a1f2e 100%);
    border-color: var(--border-color);
}

body.dark-theme .admin-card:hover {
    background: linear-gradient(135deg, var(--card-background) 0%, #312e81 100%);
    box-shadow: 0 20px 40px -15px rgba(129, 140, 248, 0.35);
    border-color: rgba(129, 140, 248, 0.2);
}

/* Pulse анімація для важливих елементів */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.8), 0 0 30px rgba(79, 70, 229, 0.4);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Ripple ефект при кліку */
@keyframes ripple-animation {
    from {
        transform: scale(0);
        opacity: 1;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Shimmer ефект для завантаження */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Анимации мигания */
@keyframes blink-green {
    50% { background-color: #dcfce7; } /* green-100 */
}
.blink-green {
    animation: blink-green 1.5s infinite;
}

@keyframes blink-red {
    50% { background-color: #fee2e2; } /* red-100 */
}
.blink-red {
    animation: blink-red 1s infinite;
    border: 2px solid #ef4444;
}

/* Анимация для заявок с новыми комментариями (желтое мигание) */
@keyframes blink-yellow {
    0%, 100% { 
        background-color: #ffffff; 
        border-left: 4px solid transparent;
    }
    50% { 
        background-color: #fef3c7; /* yellow-100 */
        border-left: 4px solid #f59e0b; /* amber-500 */
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    }
}
.has-new-comments {
    animation: blink-yellow 2s infinite;
    transition: all 0.3s ease;
}

@keyframes blink-stat-icon {
    50% { background-color: #a7f3d0; } /* green-200 */
}
.blink-stat-icon {
    animation: blink-stat-icon 1.5s infinite;
}

/* Анимация появления нового элемента */
@keyframes new-item-fade-in {
    from {
        background-color: #fef9c3; /* yellow-100 */
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }
    50% {
        background-color: #fef9c3;
    }
    to {
        background-color: transparent;
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.new-item-animation {
    animation: new-item-fade-in 1.5s ease-out forwards;
}

/* Toast Notifications */
.toast-notification {
    animation: toast-in 0.5s ease-out forwards;
}

.toast-notification.closing {
    animation: toast-out 0.5s ease-in forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toggle Switch Styles */
.toggle-checkbox:checked {
    right: 0;
    border-color: var(--primary-color);
}
.toggle-checkbox:checked + .toggle-label {
    background-color: var(--primary-color);
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day {
    padding: 0.5rem;
    text-align: center;
    min-height: 80px;
    background-color: #f8fafc;
    border-radius: 0.25rem;
}
.calendar-day.other-month {
    color: #9ca3af; /* gray-400 */
}
.calendar-event {
    display: block;
    font-size: 0.75rem;
    padding: 2px 4px;
    margin-top: 4px;
    border-radius: 0.25rem;
    background-color: #e0e7ff; /* indigo-100 */
    color: #4338ca; /* indigo-800 */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Calendar Mobile Responsive Styles */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 1px;
        font-size: 0.7rem;
    }
    
    .calendar-day {
        padding: 2px;
        min-height: 55px;
        font-size: 0.7rem;
        position: relative;
    }
    
    .calendar-day > div:first-child {
        font-size: 0.75rem;
        margin-bottom: 2px;
        font-weight: 700;
    }
    
    .calendar-day .text-xs {
        font-size: 0.5rem !important;
        padding: 2px 1px !important;
        margin-bottom: 1px !important;
        line-height: 1.1;
        font-weight: 600 !important;
        word-break: break-all;
        white-space: normal;
        text-align: center;
        min-height: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Индикатор количества выездов */
    .calendar-day .visit-count {
        position: absolute;
        top: 2px;
        right: 2px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        width: 14px;
        height: 14px;
        font-size: 0.6rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        z-index: 10;
    }
    
    #calendar-month-year {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
    }
    
    #calendar-prev-month,
    #calendar-next-month {
        padding: 0.4rem !important;
        font-size: 0.875rem;
        min-width: 36px;
    }
    
    #calendar-technician-filter {
        width: 100% !important;
        max-width: 180px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        gap: 1px;
    }
    
    .calendar-day {
        padding: 2px;
        min-height: 48px;
        font-size: 0.65rem;
    }
    
    .calendar-day > div:first-child {
        font-size: 0.7rem;
        margin-bottom: 1px;
        font-weight: 700;
    }
    
    .calendar-day .text-xs {
        font-size: 0.5rem !important;
        padding: 2px 1px !important;
        margin-bottom: 1px !important;
        font-weight: 700 !important;
        text-align: center;
        line-height: 1;
    }
    
    .calendar-day .visit-count {
        width: 12px;
        height: 12px;
        font-size: 0.55rem;
        top: 1px;
        right: 1px;
    }
    
    .p-2.text-center.font-semibold.text-slate-600.border-b {
        padding: 0.2rem !important;
        font-size: 0.6rem !important;
        font-weight: 700 !important;
    }
    
    /* Улучшение контраста для выездов на мобильных */
    .calendar-day div[onclick] {
        border: 1px solid rgba(0, 0, 0, 0.15);
    }
    
    #calendar-month-year {
        font-size: 0.85rem !important;
    }
}

/* SLA Styles */
.sla-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}
.sla-breached {
    background-color: #fee2e2; /* red-100 */
    color: #dc2626; /* red-600 */
}
.sla-warning {
    background-color: #ffedd5; /* orange-100 */
    color: #f97316; /* orange-500 */
}
.sla-info-box {
    padding: 0.75rem;
    border-left-width: 4px;
    border-radius: 0.25rem;
}
.sla-met { border-color: #22c55e; background-color: #f0fdf4; }
.sla-pending { border-color: #f97316; background-color: #fff7ed; }
.sla-breached { border-color: #ef4444; background-color: #fef2f2; }
.sla-paused { border-color: #6b7280; background-color: #f8fafc; }

/* Comment Drop Zone */
.comment-drop-zone-active {
    border-color: var(--primary-color) !important;
    border-style: dashed !important;
    background-color: #eef2ff; /* Indigo 50 */
}

/* Rating Stars */
.rating-preview .fa-star,
.rating-modal-stars .fa-star {
    transition: color 0.2s ease-in-out;
}

.rating-preview .fa-star:hover,
.rating-modal-stars .fa-star:hover {
    transform: scale(1.1);
}

/* Rating Comment Display */
.rating-comment-display {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-style: italic;
    color: #64748b;
}

.rating-comment-display p {
    margin: 0;
    line-height: 1.5;
}

/* Modal Rating Form */
#rating-modal textarea {
    resize: vertical;
    min-height: 80px;
}

#rating-modal .rating-modal-stars .fa-star {
    margin: 0 0.25rem;
    cursor: pointer;
}

/* Rating Section */
#rating-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
}

#rating-section .flex {
    gap: 0.25rem;
}

/* Стили для системы уведомлений */
.notification-toast {
    max-width: 400px;
    z-index: 9999;
}

.notification-item:hover {
    background-color: #f8fafc;
}

.notification-item.unread {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

/* Анимация мигания для заявок с новыми комментариями */
.highlight-new-comment {
    animation: highlightPulse 2s infinite;
    background-color: #fef3c7 !important;
    border-left: 4px solid #f59e0b !important;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: #fef3c7;
        transform: scale(1);
    }
    50% {
        background-color: #fbbf24;
        transform: scale(1.02);
    }
}

/* Стили для колокольчика уведомлений */
#notification-bell-btn {
    position: relative;
    transition: all 0.3s ease;
}

#notification-bell-btn:hover {
    transform: scale(1.1);
}

#notification-counter,
#mobile-notification-counter {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Стили для dropdown уведомлений */
#notification-dropdown {
    max-height: 400px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.notification-item {
    transition: background-color 0.2s ease;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #3b82f6;
}

/* Анимации для всплывающих уведомлений */
.notification-toast {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Мобильные стили */
@media (max-width: 768px) {
    #notification-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 60px);
        border-radius: 0;
        margin: 0;
    }
    
    .notification-toast {
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }
}

/* Индикатор новых сообщений в списке заявок */
.ticket-card.has-new-comments {
    border-left: 4px solid #fbbf24;
    background-color: #fffbeb;
    animation: subtlePulse 3s infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        background-color: #fffbeb;
    }
    50% {
        background-color: #fef3c7;
    }
}

/* Стили для системы уведомлений */
.notification-toast {
    max-width: 384px;
    word-wrap: break-word;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.notification-toast .close-toast {
    transition: all 0.2s ease-in-out;
}

.notification-toast .close-toast:hover {
    transform: scale(1.1);
}

/* Стили для dropdown уведомлений */
#notification-dropdown {
    max-height: 400px;
    min-width: 320px;
}

.notification-item {
    transition: background-color 0.2s ease-in-out;
}

.notification-item:hover {
    background-color: #f8fafc !important;
}

.notification-item.unread {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

/* Анимация пульсации для счетчика уведомлений */
@keyframes pulse-notification {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#notification-counter.pulse,
#mobile-notification-counter.pulse {
    animation: pulse-notification 1s ease-in-out infinite;
}

/* Стили для индикатора непрочитанного уведомления */
.notification-dot {
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Multi-select стили */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-trigger {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 2.5rem;
}

.multi-select-trigger:hover {
    border-color: #cbd5e1;
}

.multi-select-trigger:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.multi-select-display {
    flex: 1;
    color: #64748b;
    font-size: 0.875rem;
}

.multi-select-display.has-selections {
    color: #1e293b;
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.multi-select-tag {
    background-color: #4f46e5;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 120px;
}

.multi-select-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-tag-close {
    cursor: pointer;
    font-weight: bold;
}

.multi-select-tag-close:hover {
    color: #fecaca;
}

.multi-select-chevron {
    color: #64748b;
    transition: transform 0.2s;
}

.multi-select-chevron.open {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.25rem;
}

.multi-select-options {
    background-color: white;
    padding: 0;
}

.multi-select-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.multi-select-select-all {
    font-size: 0.75rem;
    color: #4f46e5;
    cursor: pointer;
    text-decoration: underline;
}

.multi-select-select-all:hover {
    color: #4338ca;
}

.multi-select-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.multi-select-option:hover {
    background-color: #f1f5f9;
}

.multi-select-option.selected {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.multi-select-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    position: relative;
}

.multi-select-checkbox.checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

.multi-select-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Темна тема для multi-select компонента */
body.dark-theme .multi-select-trigger {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .multi-select-trigger:hover {
    border-color: #475569;
    background-color: #475569;
}

body.dark-theme .multi-select-trigger:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

body.dark-theme .multi-select-display {
    color: #cbd5e1;
}

body.dark-theme .multi-select-display.has-selections {
    color: #f1f5f9;
}

body.dark-theme .multi-select-tag {
    background-color: #818cf8;
    color: #0f172a;
}

body.dark-theme .multi-select-tag-close:hover {
    color: #e0e7ff;
}

body.dark-theme .multi-select-chevron {
    color: #cbd5e1;
}

body.dark-theme .multi-select-dropdown {
    background-color: #334155 !important;
    border-color: #475569 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .multi-select-options {
    background-color: #334155 !important;
}

body.dark-theme .multi-select-header {
    border-bottom-color: #475569 !important;
    background-color: #1e293b !important;
}

body.dark-theme .multi-select-select-all {
    color: #818cf8 !important;
}

body.dark-theme .multi-select-select-all:hover {
    color: #a5b4fc !important;
}

body.dark-theme .multi-select-option {
    color: #f1f5f9 !important;
    background-color: #334155 !important;
}

body.dark-theme .multi-select-option:hover {
    background-color: #475569 !important;
}

body.dark-theme .multi-select-option.selected {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

body.dark-theme .multi-select-checkbox {
    border-color: #64748b !important;
}

body.dark-theme .multi-select-checkbox.checked {
    background-color: #818cf8 !important;
    border-color: #818cf8 !important;
}

/* Стили для модального окна недоступности сервера */
#server-offline-modal {
    z-index: 9999;
}

#server-offline-modal .backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* Дополнительные анимации для модального окна */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 30px rgba(239, 68, 68, 0.6); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Стили для фоновых элементов */
#server-offline-modal .absolute.top-10.left-10 {
    animation: float 4s ease-in-out infinite;
}

#server-offline-modal .absolute.top-20.right-20 {
    animation: bounce 2s infinite;
    animation-delay: 0.5s;
}

#server-offline-modal .absolute.bottom-20 {
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    animation-delay: 1s;
}

#server-offline-modal .absolute.bottom-10 {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-delay: 1.5s;
}

/* Улучшенная анимация появления модального окна */
#server-offline-content {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Responsive стили для мобильных устройств */
@media (max-width: 640px) {
    #server-offline-modal .max-w-md {
        max-width: 90%;
        margin: 1rem;
    }
    
    #server-offline-modal .p-8 {
        padding: 1.5rem;
    }
}

/* Мобильная оптимизация */
@media (max-width: 768px) {
    /* Увеличенные touch-области для кнопок */
    button, a, .cursor-pointer {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Компактные карточки статистики */
    .stat-card {
        padding: 0.75rem !important;
    }
    
    /* Оптимизация текста */
    h1 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }
    
    /* Карточки заявок с лучшим отступом */
    .ticket-card {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Модальные окна на весь экран */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Sticky header оптимизация */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    /* Скрытие overflow для body при открытом меню */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Dropdown на всю ширину */
    .dropdown-menu {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
    }
}

/* Оптимизация для маленьких экранов */
@media (max-width: 480px) {
    /* Еще более компактные отступы */
    .container, .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Уменьшение размера иконок */
    .fa-3x { font-size: 2rem !important; }
    .fa-2x { font-size: 1.5rem !important; }
    
    /* Grid с одной колонкой */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Кнопки на всю ширину */
    .btn-block-mobile {
        width: 100%;
        display: block;
    }
}

/* Landscape orientation для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    /* Компактный header */
    header {
        height: auto;
    }
    
    nav {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* Reduce vertical spacing */
    .mb-6, .my-6 {
        margin-bottom: 1rem !important;
    }
    
    .mb-8, .my-8 {
        margin-bottom: 1.5rem !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Увеличенные области для touch */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Предотвращает zoom при фокусе на iOS */
    }
    
    /* Убираем hover эффекты */
    .hover\:shadow-xl:hover {
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important;
    }
    
    /* Более явный active state */
    button:active, a:active, .cursor-pointer:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix для 100vh на iOS */
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
    
    /* Smooth scroll */
    html {
        -webkit-overflow-scrolling: touch;
    }
}

/* Phone Dialog Styles */
.keypad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.phone-tab-btn.active {
    border-color: #4f46e5 !important;
    color: #4f46e5 !important;
}

.phone-tab-btn:hover {
    color: #4f46e5 !important;
}

/* Call widget animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse-call {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.call-widget-enter {
    animation: slideInRight 0.3s ease-out;
}

.call-widget-exit {
    animation: slideOutRight 0.3s ease-in;
}

#active-call-widget {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#minimized-call-widget {
    animation: pulse-call 2s infinite;
}

#minimized-call-widget:hover {
    animation: none;
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Conference modal animation */
.modal-enter {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Phone number input formatting */
#conference-number {
    font-family: 'Courier New', monospace;
}

/* Call status indicators */
.call-status-connecting::before {
    content: "📞 ";
    animation: pulse 1s infinite;
}

.call-status-active::before {
    content: "✅ ";
}

.call-status-paused::before {
    content: "⏸️ ";
}

.call-status-holding::before {
    content: "⏳ ";
}

/* Language Switcher Styles */
#language-dropdown {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#language-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#language-dropdown:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.language-option {
    transition: background-color 0.15s ease;
    border: 0;
    cursor: pointer;
    position: relative;
    font-size: 0.875rem;
}

.language-option:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.language-option:hover .fa-check {
    color: white !important;
}

.language-option .fa-check {
    color: var(--primary-color);
    transition: color 0.15s ease;
}

body.dark-theme #language-dropdown {
    background-color: var(--dropdown-bg);
    border-color: var(--border-color);
}

body.dark-theme .language-option:hover {
    background-color: var(--primary-color) !important;
}

/* Language button pulse animation on change */
@keyframes language-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

#language-toggle.changing-language {
    animation: language-pulse 0.3s ease-in-out;
}

/* Refresh button styles */
#refresh-tickets-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

#refresh-tickets-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

#refresh-tickets-btn:active:not(:disabled) {
    transform: scale(0.95);
}

#refresh-tickets-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#refresh-tickets-btn .fa-spin {
    animation: fa-spin 1s infinite linear;
}

/* Анимация вращения (резервная, если FontAwesome не загрузился) */
@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Стили для индикатора автообновления */
#auto-update-indicator {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

