/**
 * Основные стили PWA 3D Редактора
 * Тёмная тема: #121212, #1e1e1e
 * Акцент (успех): #39ff14, #00e676
 * Предупреждение: #ff6d00, #ff9100
 */

/* ============================================
   CSS ПЕРЕМЕННЫЕ
   ============================================ */
:root {
    /* Основные цвета */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #333333;

    /* Текст */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;

    /* Акценты */
    --accent-green: #39ff14;
    --accent-green-dim: #00e676;
    --accent-orange: #ff6d00;
    --accent-orange-dim: #ff9100;

    /* Состояния */
    --success: #00e676;
    --warning: #ff9100;
    --error: #ff1744;
    --info: #2979ff;

    /* Размеры */
    --header-height: 60px;
    --sidebar-width: 280px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.5);

    /* Переходы */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================
   СБРОС И БАЗОВЫЕ СТИЛИ
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-green-dim);
}

img {
    max-width: 100%;
    height: auto;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   СКРОЛЛБАР
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* ============================================
   ЗАГОЛОВКИ
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* ============================================
   КОНТЕЙНЕР
   ============================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ШАПКА
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-right: 30px;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.header__nav-link {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.header__nav-link:hover,
.header__nav-link--active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

.header__user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.header__user:hover {
    background: var(--bg-tertiary);
}

.header__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-green);
}

.header__user-name {
    font-weight: 500;
}

/* ============================================
   КНОПКИ
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.btn--primary:hover {
    background: var(--accent-green-dim);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn--secondary:hover {
    background: var(--bg-hover);
}

.btn--warning {
    background: var(--accent-orange);
    color: var(--bg-primary);
}

.btn--warning:hover {
    background: var(--accent-orange-dim);
}

.btn--danger {
    background: var(--error);
    color: var(--text-primary);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn--lg {
    padding: 14px 28px;
    font-size: 1.125rem;
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   ФОРМЫ
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   КАРТОЧКИ
   ============================================ */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.card__image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.card__body {
    padding: 16px;
}

.card__title {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   СЕТКА
   ============================================ */
.grid {
    display: grid;
    gap: 20px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ============================================
   КАСТОМНЫЕ УВЕДОМЛЕНИЯ
   ============================================ */
.notification-container {
    position: fixed;
    top: calc(var(--header-height) + 20px);
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-green);
    animation: slideIn 0.3s ease;
}

.notification--success { border-left-color: var(--success); }
.notification--warning { border-left-color: var(--warning); }
.notification--error { border-left-color: var(--error); }
.notification--info { border-left-color: var(--info); }

.notification__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification__content {
    flex: 1;
}

.notification__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification__message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

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

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

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay--active .modal {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.modal__title {
    font-size: 1.25rem;
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal__body {
    padding: 20px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--bg-tertiary);
}

/* ============================================
   БЕЙДЖИ
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--success { background: rgba(0, 230, 118, 0.2); color: var(--success); }
.badge--warning { background: rgba(255, 145, 0, 0.2); color: var(--warning); }
.badge--error { background: rgba(255, 23, 68, 0.2); color: var(--error); }
.badge--info { background: rgba(41, 121, 255, 0.2); color: var(--info); }

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination__item {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination__item:hover,
.pagination__item--active {
    background: var(--accent-green);
    color: var(--bg-primary);
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================ */
@media (max-width: 768px) {
    .header__nav {
        display: none;
    }

    .header__logo {
        font-size: 1.25rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}
