/* Основные стили для Ditz TimeTrack */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Кастомные стили для компонентов */
.shadow-custom {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

/* Стили для статусов */
.status-active {
    background-color: #10b981;
    color: white;
}

.status-inactive {
    background-color: #6b7280;
    color: white;
}

.status-pending {
    background-color: #f59e0b;
    color: white;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Стили для таблиц */
.table-custom {
    border-collapse: collapse;
    width: 100%;
}

.table-custom th,
.table-custom td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table-custom th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.shift-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: #e5e7eb;
}

.shift-icon.on {
    background-color: #22c55e;
}

.shift-icon.off {
    background-color: #9ca3af;
}

/* Стили для форм */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 55%,
        calc(100% - 12px) 55%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-input:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Стили для модального окна просмотра сотрудника */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

.tab-btn {
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn.active {
    border-bottom-width: 2px;
    border-color: #3b82f6;
    color: #2563eb;
}

.tab-btn:hover:not(.active) {
    color: #374151;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для карточек статистики */
.bg-blue-50 { background-color: #eff6ff; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-red-50 { background-color: #fef2f2; }
.bg-indigo-50 { background-color: #eef2ff; }

/* Messenger specific styles */
.chat-item {
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.chat-item:hover {
    background-color: #f9fafb;
    border-color: #e5e7eb;
}

.chat-item.active {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.message {
    margin-bottom: 16px;
}

.message.sent {
    margin-left: auto;
}

.message.received {
    margin-right: auto;
}

#messagesContainer {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Custom scrollbar for messages */
#messagesContainer::-webkit-scrollbar {
    width: 6px;
}

#messagesContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#messagesContainer::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#messagesContainer::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation for new messages */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate__slideIn {
    animation: slideIn 0.3s ease-out;
}

/* Online status indicator */
.status-online {
    box-shadow: 0 0 0 2px white;
}

/* Type selector in modal */
.type-selector.active {
    background-color: #eff6ff;
}

.type-selector.active i {
    color: #3b82f6 !important;
}

/* Message input focus effect */
#messageInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive adjustments for messenger */
@media (max-width: 1024px) {
    .flex-col.lg\\:flex-row {
        flex-direction: column;
    }
    
    .lg\\:w-1\\/3, .lg\\:w-2\\/3 {
        width: 100%;
        height: 50vh;
    }
    
    .hidden.xl\\:block {
        display: none;
    }
}

/* Loading animation for messages */
@keyframes pulseMessage {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}

.loading-message {
    animation: pulseMessage 1.5s infinite;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 16px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #94a3b8;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Side Panel Styles - Air Bubble Design */
#sidePanel {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.8);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

#sidePanelOverlay {
    transition: opacity 0.3s ease;
}

/* Air bubble entrance animation */
@keyframes slideInBubble {
    from {
        transform: translateX(100%) translateY(-50%);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(-50%);
        opacity: 1;
    }
}

@keyframes slideOutBubble {
    from {
        transform: translateX(0) translateY(-50%);
        opacity: 1;
    }
    to {
        transform: translateX(100%) translateY(-50%);
        opacity: 0;
    }
}

#sidePanel.open {
    animation: slideInBubble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#sidePanel.closing {
    animation: slideOutBubble 0.3s ease forwards;
}

/* Overlay animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#sidePanelOverlay.show {
    animation: fadeIn 0.3s ease forwards;
}

#sidePanelOverlay.hiding {
    animation: fadeOut 0.3s ease forwards;
}

/* Panel content scroll */
#sidePanel > div > div:nth-child(2) {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

#sidePanel > div > div:nth-child(2)::-webkit-scrollbar {
    width: 4px;
}

#sidePanel > div > div:nth-child(2)::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

#sidePanel > div > div:nth-child(2)::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

#sidePanel > div > div:nth-child(2)::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Action buttons styling */
.action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::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.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Channel items styling */
.channel-item {
    transition: all 0.2s ease;
}

.channel-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Event items styling */
.event-item {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.event-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-item:hover::after {
    opacity: 1;
}

.event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Statistics cards */
#sidePanel .grid.grid-cols-4 > div {
    transition: all 0.2s ease;
    position: relative;
}

#sidePanel .grid.grid-cols-4 > div:hover {
    transform: scale(1.05);
    z-index: 10;
}

#sidePanel .grid.grid-cols-4 > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidePanel .grid.grid-cols-4 > div:hover::before {
    opacity: 1;
}

/* Close button styling */
#closeSidePanelBtn {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

#closeSidePanelBtn:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    transform: rotate(90deg);
}

/* Keyboard shortcut styling */
kbd {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Floating effect */
#sidePanel {
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidePanel {
        width: 90%;
        max-width: 400px;
        margin-right: 16px;
        top: 50%;
        transform: translateX(100%) translateY(-50%);
    }
    
    #sidePanel.open {
        animation: slideInBubbleMobile 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    
    @keyframes slideInBubbleMobile {
        from {
            transform: translateX(100%) translateY(-50%);
            opacity: 0;
        }
        to {
            transform: translateX(0) translateY(-50%);
            opacity: 1;
        }
    }
}

/* Glass effect for panel header */
#sidePanel .bg-gradient-to-r.from-blue-50.to-blue-100 {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(219, 234, 254, 0.9));
    backdrop-filter: blur(10px);
}

/* Smooth transitions for all interactive elements */
#sidePanel * {
    transition-property: color, background-color, border-color, transform, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent body scroll when panel is open */
body.panel-open {
    overflow: hidden;
}

/* Improved button for opening panel */
#openSidePanelBtn, #quickActionsBtn {
    transition: all 0.2s ease;
}

#openSidePanelBtn:hover, #quickActionsBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Side panel content scroll */
#sidePanel > div > div:nth-child(2) {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Animation for panel items */
#sidePanel button, #sidePanel .cursor-pointer {
    transition: all 0.2s ease;
}

#sidePanel button:hover, #sidePanel .cursor-pointer:hover {
    transform: translateX(2px);
}

/* Panel section headers */
.panel-section {
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
}

/* Form improvements */
textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background-color: white;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: var(--primary-color);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-error {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-body {
    padding: 1rem 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
}

.tooltip:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: -5px;
}

/* Avatar styles */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
}

.avatar-small {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-medium {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-large {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* Gradient backgrounds */
.bg-gradient-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.bg-gradient-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Progress bar */
.progress-bar {
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider-text {
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 12rem;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #1d4ed8;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab {
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: #374151;
}

.tab.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-item {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.page-item:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.page-item.active {
    background-color: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

.page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Notification bell */
.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 1rem;
    height: 1rem;
    background-color: #ef4444;
    color: white;
    border-radius: 9999px;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tag input */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin: 0.125rem;
}

.tag-remove {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
}

.tag-remove:hover {
    color: #6b7280;
}

/* Range slider */
.range-slider {
    width: 100%;
    height: 0.375rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    outline: none;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background-color: #3b82f6;
    border-radius: 9999px;
    cursor: pointer;
    -webkit-appearance: none;
}

.range-slider::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background-color: #3b82f6;
    border-radius: 9999px;
    cursor: pointer;
    border: none;
}

/* Color swatches */
.color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
