/* Основные стили с градиентным дизайном */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --light-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Контейнеры */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Навигация */
.navbar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.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;
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: var(--text-light);
}

.btn-success {
    background: var(--success-gradient);
    color: var(--text-light);
}

.btn-danger {
    background: var(--danger-gradient);
    color: var(--text-light);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.btn:active {
    transform: translateY(-1px);
}

/* Формы */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    transition: var(--transition);
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: var(--light-gradient);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

.stat-new {
    background: var(--success-gradient);
    color: var(--text-light);
}

.stat-removed {
    background: var(--danger-gradient);
    color: var(--text-light);
}

/* Таблицы */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow);
    margin: 20px 0;
    position: relative;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px; /* Минимальная ширина для всех колонок */
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* Оптимизация ширины колонок для таблицы пользователей */
.table th:nth-child(1), .table td:nth-child(1) { width: 120px; } /* User ID */
.table th:nth-child(2), .table td:nth-child(2) { width: 100px; } /* Имя */
.table th:nth-child(3), .table td:nth-child(3) { width: 100px; } /* Фамилия */
.table th:nth-child(4), .table td:nth-child(4) { width: 120px; } /* Username */
.table th:nth-child(5), .table td:nth-child(5) { width: 150px; } /* Био */
.table th:nth-child(6), .table td:nth-child(6) { width: 120px; } /* Телефон */
.table th:nth-child(7), .table td:nth-child(7) { width: 100px; } /* Premium */
.table th:nth-child(8), .table td:nth-child(8) { width: 100px; } /* Статус */
.table th:nth-child(9), .table td:nth-child(9) { width: 150px; } /* Последний онлайн */
.table th:nth-child(10), .table td:nth-child(10) { width: 120px; } /* Дата добавления */
.table th:nth-child(11), .table td:nth-child(11) { width: 150px; } /* Дата парсинга */
.table th:nth-child(12), .table td:nth-child(12) { width: 200px; } /* Группа */
.table th:nth-child(13), .table td:nth-child(13) { width: 80px; } /* Ссылка на группу */

/* Специальные стили для колонок */
.table td:nth-child(5) { /* Био */
    white-space: normal;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table td:nth-child(12) { /* Группа */
    white-space: normal;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table td:nth-child(1) { /* User ID */
    font-family: monospace;
    font-size: 12px;
}

.table th {
    background: var(--dark-gradient);
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    white-space: nowrap;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.sortable:hover {
    background: linear-gradient(135deg, #5a6fd8, #6b5b95) !important;
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sortable:hover .sort-icon {
    opacity: 1;
}

.sort-icon.active {
    opacity: 1;
    color: #ffd700;
}

.sort-icon.asc::after {
    content: " ↑";
    color: #4facfe;
}

.sort-icon.desc::after {
    content: " ↓";
    color: #fa709a;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transition: background-color 0.2s ease;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-new {
    background: var(--success-gradient);
    color: var(--text-light);
}

.status-removed {
    background: var(--danger-gradient);
    color: var(--text-light);
}

.status-pending {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #8b4513;
}

.status-updated {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #2c3e50;
}

.premium {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b4513;
}

.regular {
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    color: #666;
}

.status-active {
    background: var(--primary-gradient);
    color: var(--text-light);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--light-gradient);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .nav-links a {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .card {
        padding: 20px;
        margin: 10px 0;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* Загрузка */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: var(--text-light);
    font-weight: 600;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        top: 10px;
    }
}

.notification-success {
    background: var(--success-gradient);
}

.notification-error {
    background: var(--danger-gradient);
}

.notification-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

/* Фильтры и поиск */
.filters-section {
    background: var(--light-gradient);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9em;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 0.9em;
    min-width: 150px;
}

.filter-input {
    min-width: 200px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Информация о результатах */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-gradient);
    border-radius: 10px;
}

.results-stats {
    font-weight: 600;
    color: var(--text-color);
}

.results-actions {
    display: flex;
    gap: 10px;
}

/* Статус бейджи */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
    display: inline-block;
}

.status-badge.premium {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b4513;
}

.status-badge.regular {
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    color: #666;
}

/* Ссылки на группы */
.group-link {
    color: #667eea;
    text-decoration: none;
    font-size: 1.2em;
    transition: all 0.2s ease;
    display: inline-block;
}

.group-link:hover {
    color: #764ba2;
    transform: scale(1.2);
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.pagination .btn {
    min-width: 40px;
    padding: 8px 12px;
    font-size: 14px;
}

.pagination .btn:hover {
    transform: translateY(-2px);
}

/* Экспорт модальное окно */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.export-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.export-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Прогресс-бар */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

.progress-message {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

/* Адаптивность для таблицы пользователей */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 1400px;
    }
    
    .table th,
    .table td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select, .filter-input {
        min-width: auto;
        width: 100%;
    }
    
    .results-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination .btn {
        min-width: 35px;
        padding: 6px 10px;
        font-size: 12px;
    }
}
