:root {
    --primary: #4a6fa5;
    --secondary: #166088;
    --accent: #ff6b6b;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

body.dark-theme {
    background-color: #121212;
    color: #f0f0f0;
}

body.menu-open {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

body.dark-theme header {
    background-color: #1e1e1e;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
}

body.dark-theme .logo-text {
    color: #64b5f6;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 4px;
    transition: var(--transition);
    display: block;
}

body.dark-theme nav a {
    color: #f0f0f0;
}

nav a:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

body.dark-theme nav a:hover {
    background-color: rgba(100, 181, 246, 0.1);
}

/* Вертикальные выпадающие меню (вниз) */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 4px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 10;
}

body.dark-theme .submenu {
    background-color: #2d2d2d;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

nav li:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    width: 100%;
}

.submenu a {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

body.dark-theme .submenu a {
    color: #f0f0f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu a:last-child {
    border-bottom: none;
}

.submenu a:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

body.dark-theme .submenu a:hover {
    background-color: rgba(100, 181, 246, 0.1);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.settings-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 20px;
}

.settings-btn:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

body.dark-theme .settings-btn:hover {
    background-color: rgba(100, 181, 246, 0.1);
}

/* Боковое меню настроек */
.settings-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

body.dark-theme .settings-menu {
    background-color: #1e1e1e;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.settings-menu.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.dark-theme .settings-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
    font-size: 24px;
    color: var(--secondary);
}

body.dark-theme .settings-header h2 {
    color: #64b5f6;
}

.close-menu {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-menu:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-theme .close-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h3 {
    margin-bottom: 15px;
    color: var(--secondary);
    font-size: 18px;
}

body.dark-theme .menu-section h3 {
    color: #64b5f6;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.menu-btn {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: rgba(74, 111, 165, 0.1);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 24px;
    text-decoration: none;
    color: inherit;
}

.menu-btn span {
    font-size: 10px;
    margin-top: 5px;
}

.menu-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.theme-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(74, 111, 165, 0.1);
    border-radius: 8px;
}

body.dark-theme .theme-switch {
    background: rgba(100, 181, 246, 0.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Variants Container */
.variants-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Variant Card */
.variant-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.variant-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a6fa5, #166088, #ff6b6b);
    border-radius: 4px 4px 0 0;
}

.variant-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* Dark theme support */
.dark-theme .variant-card {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Variant Header */
.variant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.variant-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
}

.dark-theme .variant-title {
    color: #f0f0f0;
}

.variant-badge {
    background: linear-gradient(135deg, #4a6fa5, #166088);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Variant Meta */
.variant-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.dark-theme .meta-item {
    color: #a0aec0;
}

.meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Variant Description */
.variant-description {
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-theme .variant-description {
    color: #a0aec0;
}

/* Variant Actions */
.variant-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn-primary {
    background: linear-gradient(135deg, #4a6fa5, #166088);
    color: white;
}

.action-btn-primary:hover {
    background: linear-gradient(135deg, #166088, #4a6fa5);
    transform: translateY(-2px);
}

.action-btn-secondary {
    background: rgba(74, 111, 165, 0.1);
    color: #4a6fa5;
    border: 1px solid rgba(74, 111, 165, 0.2);
}

.action-btn-secondary:hover {
    background: rgba(74, 111, 165, 0.2);
    transform: translateY(-2px);
}

.dark-theme .action-btn-secondary {
    background: rgba(74, 111, 165, 0.2);
    color: #a0aec0;
    border: 1px solid rgba(74, 111, 165, 0.3);
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a6fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Error State */
.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.dark-theme .error-message {
    color: #a0aec0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.dark-theme .empty-state {
    color: #a0aec0;
}

/* Responsive */
@media (max-width: 768px) {
    .variants-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .variant-card {
        padding: 1rem;
    }

    .variant-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: auto;
    }
}
