: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 */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}
/* Анимация появления */
.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: transform 0.3s, box-shadow 0.3s;
}
.ticket-card:hover, .stat-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);
}
.drop-zone-active {
    border-color: var(--primary-color);
    background-color: #eef2ff; /* Indigo 50 */
}
.stat-card-active {
    box-shadow: 0 0 0 2px var(--primary-color);
    transform: translateY(-5px);
}

/* Анимации мигания */
@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;
}

/* 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-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%);
}

/* Стили для модального окна недоступности сервера */
#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;
    }
}

/* 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: "⏳ ";
}
