/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #1a1a2e;
    --primary: #6d28d9;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --gov: #059669;
    --gov-light: #10b981;
    --complaint: #dc2626;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border: #2d3748;
    --selection-bg: rgba(109, 40, 217, 0.5);
    --selection-color: #ffffff;
    --select-bg: rgba(255, 255, 255, 0.08);
    --select-option-bg: #1a1a2e;
}

::selection {
    background-color: var(--selection-bg);
    color: var(--selection-color);
}

::-moz-selection {
    background-color: var(--selection-bg);
    color: var(--selection-color);
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Шапка */
.header {
    background: var(--bg-dark);
    border-bottom: 2px solid var(--primary);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s;
}

.logo-btn:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.github-link {
    color: var(--text-primary);
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s;
    margin-left: 10px;
}

.github-link:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.admin-status {
    font-size: 14px;
    color: var(--success);
}

/* Основной контейнер */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Панель вкладок */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    padding: 12px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #2a2a3e;
}

.tab-btn.active {
    background: var(--bg-dark);
    border-color: var(--primary);
    border-bottom-color: transparent;
    color: var(--primary);
}

/* Содержимое вкладок */
.tab-content {
    background: var(--bg-dark);
    border-radius: 8px;
    min-height: 500px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Карточки */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.card-title {
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gov-color {
    color: var(--gov) !important;
}

.complaint-color {
    color: var(--complaint) !important;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Стили для обычных полей ввода */
.form-input[type="text"],
.form-input[type="number"],
.form-input[type="password"] {
    width: 100%;
    background: var(--select-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s;
    caret-color: var(--primary);
}

.form-input[type="text"]:focus,
.form-input[type="number"]:focus,
.form-input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

/* Стили для выпадающих списков (select) */
.form-input:is(select) {
    width: 100%;
    background: var(--select-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-input:is(select):focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

/* Стили для опций в выпадающих списках */
.form-input:is(select) option {
    background-color: var(--select-option-bg);
    color: var(--text-primary);
    padding: 10px;
    font-size: 14px;
}

.form-input:is(select) option:checked {
    background-color: var(--primary);
    color: white;
}

.form-input:is(select) option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Для Firefox - специальные стили */
@-moz-document url-prefix() {
    .form-input:is(select) {
        color: var(--text-primary);
        text-shadow: 0 0 0 var(--text-primary);
    }
    
    .form-input:is(select) option {
        background-color: var(--select-option-bg);
        color: var(--text-primary);
    }
}

/* Стили для текстовых областей */
.form-textarea {
    width: 100%;
    background: var(--select-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
    caret-color: var(--primary);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

/* Разделитель */
.separator {
    height: 2px;
    margin: 25px 0;
}

.gov-bg {
    background: var(--gov) !important;
}

.complaint-bg {
    background: var(--complaint) !important;
}

.section-title {
    font-size: 18px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gov-light-color {
    color: var(--gov-light) !important;
}

/* Кнопки */
.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.status-text {
    text-align: center;
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Радиокнопки */
.radio-group {
    display: flex;
    gap: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-text {
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.3s;
    user-select: none;
}

.radio-label input:checked + .radio-text {
    border-color: var(--primary);
    background: rgba(109, 40, 217, 0.1);
}

.radio-label input {
    display: none;
}

/* Контейнер пароля */
.password-container {
    display: flex;
    gap: 10px;
}

.login-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.login-btn:hover {
    opacity: 0.9;
}

.hint-btn {
    background: var(--warning);
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.hint-btn:hover {
    opacity: 0.9;
}

/* Таблица */
.data-table {
    background: var(--bg-dark);
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.table-header {
    display: grid;
    background: var(--primary);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.header-cell {
    padding: 12px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

.header-cell:last-child {
    border-right: none;
}

.table-body {
    max-height: 300px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.3s;
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table-row.selected {
    background: rgba(109, 40, 217, 0.2);
}

.table-cell {
    padding: 12px;
    font-size: 14px;
    text-align: center;
    border-right: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

.table-cell:last-child {
    border-right: none;
}

.empty-message {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    user-select: none;
}

/* Кнопки действий */
.action-buttons {
    margin-top: 20px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    user-select: none;
}

.view-btn {
    background: #3b82f6;
    color: white;
}

.accept-btn {
    background: #10b981;
    color: white;
}

.reject-btn {
    background: #ef4444;
    color: white;
}

.delete-btn {
    background: #6b7280;
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.logout-btn {
    width: 100%;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    user-select: none;
}

.logout-btn:hover {
    opacity: 0.9;
}

/* Информационная вкладка */
.info-content {
    line-height: 1.6;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section ul {
    padding-left: 20px;
    color: var(--text-secondary);
}

.info-section p {
    color: var(--text-secondary);
    padding-left: 30px;
}

.github-link-text {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
}

.github-link-text:hover {
    color: var(--gov-light);
    text-decoration: underline;
}

.website-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    user-select: none;
}

.website-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.github-btn {
    width: 100%;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    user-select: none;
}

.github-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.details-modal {
    max-width: 700px;
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 25px;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    padding: 0 25px 25px;
    text-align: center;
}

.modal-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn:hover {
    opacity: 0.9;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo-container {
        justify-content: center;
    }
    
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        min-width: 100px;
        font-size: 12px;
        padding: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .table-row {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .header-cell,
    .table-cell {
        padding: 8px;
        font-size: 12px;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .password-container {
        flex-direction: column;
    }
    
    .login-btn,
    .hint-btn {
        width: 100%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
    }
}