/* Основные стили для системы управления должностными папками */

/* Переменные цветов для департаментов */
:root {
    --dept-admin-color: #3B82F6;      /* Синий - Административный */
    --dept-finance-color: #10B981;     /* Зелёный - Финансовый */  
    --dept-hr-color: #8B5CF6;         /* Фиолетовый - Персонал */
    --dept-sales-color: #F59E0B;      /* Оранжевый - Коммерческий */
    --dept-production-color: #EF4444; /* Красный - Производственный */
    --dept-quality-color: #84CC16;    /* Лайм - Качество */
    --dept-development-color: #06B6D4; /* Голубой - Расширение */
}

/* Стили для табов */
.tab-button.active {
    border-bottom-color: #3B82F6;
    color: #1F2937;
}

.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Карточки департаментов */
.department-card {
    transition: all 0.3s ease;
    border-left: 4px solid #e5e7eb;
}

.department-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.department-card.dept-1 { border-left-color: var(--dept-admin-color); }
.department-card.dept-2 { border-left-color: var(--dept-sales-color); }
.department-card.dept-3 { border-left-color: var(--dept-finance-color); }
.department-card.dept-4 { border-left-color: var(--dept-production-color); }
.department-card.dept-5 { border-left-color: var(--dept-quality-color); }
.department-card.dept-6 { border-left-color: var(--dept-development-color); }
.department-card.dept-7 { border-left-color: var(--dept-admin-color); }

/* Цвета статусов */
.status-draft { @apply bg-gray-100 text-gray-800; }
.status-in-development { @apply bg-yellow-100 text-yellow-800; }
.status-under-review { @apply bg-blue-100 text-blue-800; }
.status-approved { @apply bg-green-100 text-green-800; }
.status-archived { @apply bg-red-100 text-red-800; }

/* Стили для организационной схемы */
.org-chart {
    min-height: 400px;
    overflow-x: auto;
    overflow-y: auto;
}

.org-chart svg {
    width: 100%;
    height: 100%;
}

.org-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.org-node:hover {
    transform: scale(1.05);
}

.org-node rect {
    fill: #ffffff;
    stroke: #d1d5db;
    stroke-width: 2;
    rx: 8;
    ry: 8;
}

.org-node.department rect {
    fill: #f3f4f6;
    stroke-width: 3;
}

.org-node.division rect {
    fill: #fafafa;
}

.org-node.position rect {
    fill: #ffffff;
}

.org-node text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    fill: #374151;
    text-anchor: middle;
    dominant-baseline: middle;
}

.org-link {
    stroke: #9ca3af;
    stroke-width: 2;
    fill: none;
}

/* Карточки должностных папок */
.job-folder-card {
    transition: all 0.3s ease;
    border-top: 4px solid #e5e7eb;
}

.job-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -3px rgba(0, 0, 0, 0.1);
}

.job-folder-card.status-draft { border-top-color: #9ca3af; }
.job-folder-card.status-in-development { border-top-color: #f59e0b; }
.job-folder-card.status-under-review { border-top-color: #3b82f6; }
.job-folder-card.status-approved { border-top-color: #10b981; }
.job-folder-card.status-archived { border-top-color: #ef4444; }

/* Стили для форм */
.form-section {
    @apply mb-6 p-4 bg-gray-50 rounded-lg;
}

.form-section h4 {
    @apply text-sm font-semibold text-gray-900 mb-3;
}

.form-group {
    @apply mb-4;
}

.form-group label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 min-h-24;
}

.form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
}

/* Список элементов */
.list-item {
    @apply flex items-center justify-between p-3 bg-gray-50 rounded-md mb-2;
}

.list-item-content {
    @apply flex-1 text-sm text-gray-700;
}

.list-item-actions {
    @apply flex space-x-2;
}

/* Кнопки действий */
.btn-action {
    @apply px-3 py-1 text-xs font-medium rounded-md transition-colors duration-200;
}

.btn-edit {
    @apply bg-blue-100 text-blue-800 hover:bg-blue-200;
}

.btn-delete {
    @apply bg-red-100 text-red-800 hover:bg-red-200;
}

.btn-view {
    @apply bg-green-100 text-green-800 hover:bg-green-200;
}

/* Анимации загрузки */
.loading {
    @apply flex items-center justify-center p-8;
}

.spinner {
    @apply animate-spin h-8 w-8 border-4 border-blue-200 border-t-blue-600 rounded-full;
}

/* Уведомления */
.notification {
    @apply max-w-sm w-full bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    @apply border-l-4 border-green-400;
}

.notification.error {
    @apply border-l-4 border-red-400;
}

.notification.warning {
    @apply border-l-4 border-yellow-400;
}

.notification.info {
    @apply border-l-4 border-blue-400;
}

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

/* Модальные окна */
.modal-backdrop {
    @apply fixed inset-0 bg-black bg-opacity-50 transition-opacity;
}

.modal-container {
    @apply relative bg-white rounded-lg max-w-4xl mx-auto my-8 shadow-xl;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    @apply px-6 py-4 border-b border-gray-200;
}

.modal-title {
    @apply text-lg font-semibold text-gray-900;
}

.modal-body {
    @apply px-6 py-4;
}

.modal-footer {
    @apply px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-end space-x-3;
}

/* Вкладки в модальных окнах */
.modal-tabs {
    @apply border-b border-gray-200 mb-6;
}

.modal-tab {
    @apply px-4 py-2 text-sm font-medium text-gray-500 border-b-2 border-transparent hover:text-gray-700 hover:border-gray-300 cursor-pointer;
}

.modal-tab.active {
    @apply text-blue-600 border-blue-600;
}

.modal-tab-content {
    @apply hidden;
}

.modal-tab-content.active {
    @apply block;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-container {
        @apply mx-4 my-4;
    }
    
    .modal-header, .modal-body, .modal-footer {
        @apply px-4;
    }
    
    .grid {
        @apply grid-cols-1;
    }
}

/* Стили для экспорта организационной схемы */
.export-controls {
    @apply flex flex-wrap gap-3 mb-4 p-4 bg-gray-50 rounded-lg;
}

.export-format-selector {
    @apply flex space-x-2;
}

.format-option {
    @apply px-3 py-1 text-sm font-medium rounded-md border cursor-pointer transition-all;
}

.format-option.active {
    @apply bg-blue-600 text-white border-blue-600;
}

.format-option:not(.active) {
    @apply bg-white text-gray-700 border-gray-300 hover:bg-gray-50;
}

/* Поисковые подсветки */
.search-highlight {
    @apply bg-yellow-200 px-1 rounded;
}

/* Прокрутка */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Фокус для доступности */
.focus\:outline-none:focus {
    outline: none;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Переходы */
.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Состояния загрузки */
.skeleton {
    @apply animate-pulse bg-gray-200 rounded;
}

.skeleton-text {
    @apply h-4 bg-gray-200 rounded w-3/4 mb-2;
}

.skeleton-text:last-child {
    @apply w-1/2 mb-0;
}