/* static/css/styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #047857;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-left: 4px solid #b91c1c;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-left: 4px solid #1d4ed8;
}

.close-notification {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-notification:hover {
    opacity: 1;
}

/* Заголовок */
.header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
}

.header-content p {
    opacity: 0.9;
}

/* Кнопки */
.btn {
    background: white;
    color: #4361ee;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #f8f9ff;
    transform: translateY(-2px);
    text-align: center;
}

.btn-primary {
    background: #4361ee;
    color: white;
    text-align: center;
    align-items: center;
}

.btn-primary:hover {
    background: #3a56d4;
    text-align: center;
    align-items: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    text-align: center;
}

.btn-secondary:hover {
    background: #5a6268;
    text-align: center;
}

.btn-danger {
    background: #dc3545;
    color: white;
    text-align: center;
}

.btn-danger:hover {
    background: #c82333;
    text-align: center;
}

/* Карточки */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.tab {
    padding: 12px 25px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab:hover {
    background: #f8f9fa;
    color: #4361ee;
}

.tab.active {
    background: #4361ee;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Формы */
.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea.input-field {
    min-height: 150px;
    resize: vertical;
}

/* Загрузка файлов */
.file-upload {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.file-upload:hover {
    border-color: #4361ee;
    background: #f8f9ff;
}

.file-upload.dragover {
    border-color: #4cc9f0;
    background: rgba(76, 201, 240, 0.05);
}

.upload-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

.file-info {
    margin-top: 10px;
    color: #6c757d;
    font-size: 14px;
}

/* Прогресс бар */
.progress-container {
    margin: 20px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4361ee, #4cc9f0);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

/* Текущая задача */
.current-task {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    font-size: 14px;
    color: #6c757d;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4361ee;
    margin-bottom: 10px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Таблицы */
.results-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
}

tbody tr:hover {
    background: #f8f9ff;
}

td {
    padding: 15px;
    color: #495057;
}

.domain-cell {
    font-weight: 600;
    color: #4361ee;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* История */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    border-color: #4361ee;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4361ee;
}

.history-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

/* Настройки */
.settings-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #4361ee;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.setting-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.setting-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Переключатель */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4361ee;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Выпадающие списки */
.select-field {
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    font-size: 14px;
    background: white;
}

/* Сообщения */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.alert.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.alert.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.empty-icon {
    font-size: 64px;
    color: #adb5bd;
    margin-bottom: 20px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4361ee;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #dc3545;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
    text-align: center;
}

/* Анимация загрузки */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Навигационные ссылки */
.nav-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        text-align: center;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* Для настроек */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #4361ee;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* Скрытый класс */
.hidden {
    display: none !important;
}

/* Стили для авторизации */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-form {
    margin-bottom: 20px;
}

.login-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-links a {
    color: #4361ee;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-info {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
}

.login-info h3 {
    margin-top: 0;
    color: #333;
}

.login-info code {
    background: #e9ecef;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Стили для массового удаления */
.bulk-actions-panel {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-info {
    font-size: 16px;
    font-weight: bold;
}

.bulk-buttons {
    display: flex;
    gap: 10px;
    text-align: center;
}

.history-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.history-item {
    position: relative;
    padding-left: 50px;
}

.history-checkbox {
    position: absolute;
    left: 15px;
    top: 15px;
}

.history-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.history-content {
    flex: 1;
}

/* Статус пользователя в шапке */
.user-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 14px;
}

.user-status .username {
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .login-card {
        padding: 25px;
    }
    
    .bulk-actions-panel {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .history-actions-bar {
        flex-direction: column;
        gap: 10px;
    }
}

/* Стили для уведомлений */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    border-left: 5px solid #28a745;
}

.notification.error {
    border-left: 5px solid #dc3545;
}

.notification.info {
    border-left: 5px solid #17a2b8;
}

.close-notification {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin: 0;
    line-height: 1;
}

/* Стили для объявлений */
.announcement-card {
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

.announcement-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.announcement-icon {
    font-size: 24px;
    margin-right: 10px;
}

.announcement-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.announcement-content {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 10px;
}

.announcement-footer {
    border-top: 1px solid #eee;
    padding-top: 10px;
    font-size: 12px;
    color: #888;
}

.announcement-date {
    font-style: italic;
}

/* Цвета для объявлений */
.alert-info {
    background-color: #e7f3ff;
    border-color: #b8daff;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.announcement-secondary {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

/* Стили для контейнера объявлений */
#announcements-container {
    margin-top: 30px;
}

#announcements-container h4 {
    color: #4361ee;
    margin-bottom: 20px;
    font-weight: 600;
}

#announcements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Стили для загрузки */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}