* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a365d;
    --primary-light: #2d4a7c;
    --accent-color: #3182ce;
    --accent-hover: #2c5aa0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.admin-logo p {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(255,255,255,0.1);
    transition: width 0.2s ease;
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(3px);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--accent-color);
}

.admin-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.admin-header {
    background: var(--bg-white);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.admin-header:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.admin-header h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.admin-content {
    max-width: 1200px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.content-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.content-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
    font-weight: 600;
}

.content-card h4 {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.form-control:hover {
    border-color: rgba(49, 130, 206, 0.3);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    transform: translateY(-1px);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons — используем единую систему из style.css */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 10px 22px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary::before,
.btn-secondary::before,
.btn-success::before,
.btn-danger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-success:hover::before,
.btn-danger:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 3px 10px rgba(49, 130, 206, 0.28);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(49, 130, 206, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background: #16A34A;
    color: white;
    border-color: #16A34A;
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.28);
}

.btn-success:hover {
    background: #15803D;
    border-color: #15803D;
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(22, 163, 74, 0.4);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-danger {
    background: #DC2626;
    color: white;
    border-color: #DC2626;
    width: 100%;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.28);
}

.btn-danger:hover {
    background: #B91C1C;
    border-color: #B91C1C;
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(220, 38, 38, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-outline-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 10px 22px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    color: var(--accent-color);
    white-space: nowrap;
    text-decoration: none;
}

.btn-outline-primary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(49, 130, 206, 0.3);
}

/* Размеры */
.btn-sm {
    padding: 7px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-small {
    padding: 7px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Feature Items */
.features-list {
    display: grid;
    gap: 1.5rem;
}

.feature-item {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    transition: all 0.2s ease;
    position: relative;
}

.feature-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-color), #2c5aa0);
    transition: width 0.2s ease;
}

.feature-item:hover::before {
    width: 6px;
}

.feature-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* News List */
.news-list {
    margin-top: 2rem;
}

.news-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: start;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.news-item-content {
    flex: 1;
}

.news-item-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.news-item-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.news-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    transition: all 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
    transform: rotate(90deg) scale(1.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions button {
    flex: 1;
}

.info-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

/* Success Message */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* Загрузка изображений */
.image-upload-options {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.upload-tabs {
    display: flex;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.upload-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.upload-tab:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--text-primary);
}

.upload-tab.active {
    background: white;
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.upload-content {
    padding: 1rem;
}

.upload-panel {
    display: none;
}

.upload-panel.active {
    display: block;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview .remove-image {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.image-preview .remove-image:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Upload Form */
.upload-form {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.upload-form .form-group {
    margin-bottom: 15px;
}

.upload-form input[type="file"] {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.upload-form input[type="file"]:hover {
    border-color: #3182ce;
}

.info-box {
    margin-top: 30px;
    padding: 20px;
    background: #e7f3ff;
    border-left: 4px solid #3182ce;
    border-radius: 6px;
}

.info-box h4 {
    margin-bottom: 15px;
    color: #1a365d;
}

.info-box ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-box ol li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-box p {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #bee3f8;
    color: #2c5aa0;
}
