/* AWG Config - Современный дизайн */

:root {
    --bg-dark: #0f0f14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.15);
    --accent-glow: rgba(0, 212, 170, 0.25);
    --text: #e8e8ed;
    --text-muted: #8b8b9a;
    --border: rgba(255, 255, 255, 0.08);
    --error: #ff6b6b;
    --success: #51cf66;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(0, 212, 170, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

.lang-switch {
    text-align: right;
    margin-bottom: 1rem;
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--accent);
}

.lang-sep {
    color: var(--text-muted);
    margin: 0 0.5rem;
    font-size: 0.85rem;
}

.download-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-dark);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: background 0.2s, transform 0.15s;
}

.btn-download:hover {
    background: #00e6b8;
    transform: translateY(-1px);
}

.btn-download-alt {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    margin-left: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.btn-download-alt:hover {
    background: var(--accent-dim);
}

.download-notice {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.guide-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.guide-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.guide-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.guide-list li {
    margin-bottom: 0.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.btn-logout {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.btn-logout:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Auth card */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 420px;
    margin: 4rem auto;
    backdrop-filter: blur(20px);
}

.auth-card.minimal {
    padding: 2rem;
}

.auth-card .minimal-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lock-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    padding: 1rem;
    background: var(--accent-dim);
    border-radius: 16px;
}

.lock-icon svg {
    width: 100%;
    height: 100%;
    color: var(--accent);
}

.auth-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms */
.auth-form, .admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea {
    resize: vertical;
    min-height: 140px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.input-full {
    width: 100%;
}

/* Buttons */
.btn-primary {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
    background: #00e6b8;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: var(--success);
}

.alert-success a {
    color: var(--accent);
    text-decoration: none;
}

.alert-success a:hover {
    text-decoration: underline;
}

.alert-success .full-link {
    display: block;
    margin: 0.5rem 0;
    word-break: break-all;
    font-size: 0.85rem;
}

.btn-copy-link {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Config cards */
.configs-grid {
    display: grid;
    gap: 1.5rem;
}

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: background 0.2s, border-color 0.2s;
}

.config-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.config-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text);
}

.config-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.btn-copy {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-copy:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-copy.copied {
    background: var(--success);
    color: var(--bg-dark);
    border-color: var(--success);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Admin */
.admin-container {
    max-width: none;
    display: flex;
    min-height: 100vh;
    padding: 0;
}

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s, background 0.2s;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-card-hover);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-right: 3px solid var(--accent);
}

.sidebar-icon {
    font-size: 1.1rem;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
}

.admin-content .admin-section {
    max-width: 700px;
}

.admin-section {
    margin-bottom: 2.5rem;
}

.admin-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.pages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.page-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.page-item .page-title {
    font-weight: 500;
    flex: 1;
}

.page-item code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.page-item .config-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.page-item a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.page-item a:hover {
    text-decoration: underline;
}

/* Admin: config list */
.configs-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.config-admin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.config-admin-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.config-page-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.config-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-edit {
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: var(--accent-dim);
}

.form-inline {
    display: inline;
}

.btn-delete {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--error);
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: rgba(255, 107, 107, 0.25);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    display: inline-block;
    transition: color 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.15);
}

.empty-msg {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.empty-msg a {
    color: var(--accent);
    text-decoration: none;
}

.empty-msg a:hover {
    text-decoration: underline;
}

.config-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
    display: block;
    margin-top: 0.35rem;
}

.config-link:hover {
    text-decoration: underline;
}

.config-link-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.btn-copy-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0,212,170,0.3);
    border-radius: 6px;
    cursor: pointer;
}

.btn-copy-sm:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination-btn {
    font-size: 0.95rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--accent-dim);
    transition: background 0.2s;
}

.pagination-btn:hover {
    background: rgba(0, 212, 170, 0.25);
}

.config-form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
}

.config-form-section h2 {
    margin-bottom: 0.25rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .sidebar-link {
        padding: 0.5rem 1rem;
    }
    
    .sidebar-link.active {
        border-right: none;
        border-bottom: 3px solid var(--accent);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1.25rem;
    }
    
    .admin-content {
        padding: 1.25rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 2rem auto;
    }
    
    .page-item {
        flex-wrap: wrap;
    }
}
