/* ===== CSS ПЕРЕМЕННЫЕ ===== */
:root {
  /* Цветовая палитра - светлая тема */
  --color-primary: #667eea;
  --color-primary-dark: #5a6fd8;
  --color-secondary: #764ba2;
  --color-accent: #4facfe;
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-error: #e74c3c;
  
  /* Текст */
  --color-text: #2c3e50;
  --color-text-light: #7f8c8d;
  --color-text-inverse: #ffffff;
  
  /* Фоны */
  --color-bg: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-dark: #2c3e50;
  --color-bg-darker: #34495e;
  
  /* Тени */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
  
  /* Скругления */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Отступы */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  
  /* Типографика */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  
  /* Анимации */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Темная тема */
[data-theme="dark"] {
  --color-text: #ecf0f1;
  --color-text-light: #bdc3c7;
  --color-bg: #2c3e50;
  --color-bg-secondary: #34495e;
  --color-bg-dark: #1a252f;
  --color-bg-darker: #2c3e50;
  --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);
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    min-height: 100vh;
    color: var(--color-text);
    transition: background 0.3s ease;
}

/* ===== КОНТЕЙНЕР СТРАНИЦЫ ===== */
.page {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--color-bg);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

/* ===== ШАПКА ===== */
.header {
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
    color: var(--color-text-inverse);
    text-align: center;
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
}

.header__title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
    margin: 0;
}

/* Переключатель темы */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-text-inverse);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== НАВИГАЦИЯ ===== */
.nav {
    background: var(--color-bg-dark);
    padding: 20px 0;
    transition: all 0.3s ease;
}

.nav__list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.nav__item {
    margin: 0;
}

.nav__link {
    color: var(--color-text-inverse);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: block;
}

.nav__link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav__item--active .nav__link {
    background: rgba(255,255,255,0.2);
    font-weight: bold;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.main {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== ГЛАВНАЯ СТРАНИЦА ===== */

/* Блок profile */
.profile {
    margin-bottom: 40px;
}

.profile__card {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--color-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.profile__photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary);
    transition: all 0.3s ease;
}

.profile__info {
    flex: 1;
}

.profile__name {
    font-size: 24px;
    color: var(--color-text);
    margin: 0 0 10px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.profile__group {
    font-size: 18px;
    color: var(--color-primary);
    margin: 0;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Блок about */
.about {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 5px solid var(--color-primary);
    transition: all 0.3s ease;
}

[data-theme="dark"] .about {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-dark) 100%);
}

.about__title {
    font-size: 24px;
    color: var(--color-text);
    margin-bottom: 15px;
    font-weight: 300;
    transition: color 0.3s ease;
}

.about__text {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    color: var(--color-text);
    transition: color 0.3s ease;
}

/* Блок skills */
.skills {
    margin: 40px 0;
}

.skills__title {
    font-size: 24px;
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 300;
    text-align: left;
    transition: color 0.3s ease;
}

.skills__list {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    flex-wrap: wrap;
}

.skill {
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.skill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Индивидуальные цвета для навыков */
.skill--html {
    background: linear-gradient(135deg, #e34c26 0%, #f06529 100%);
}

.skill--css {
    background: linear-gradient(135deg, #264de4 0%, #2965f1 100%);
}

.skill--js {
    background: linear-gradient(135deg, #f0db4f 0%, #f7df1e 100%);
    color: #2c3e50;
}

[data-theme="dark"] .skill--js {
    color: #2c3e50;
}

/* Блок projects */
.projects {
    margin: 40px 0;
}

.projects__title {
    font-size: 24px;
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 300;
    text-align: left;
    transition: color 0.3s ease;
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    justify-items: start;
}

.project-card {
    background: var(--color-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-primary);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card__title {
    font-size: 18px;
    color: var(--color-text);
    margin: 0 0 10px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-card__desc {
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
}

/* ===== ФУТЕР ===== */
.footer {
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
    color: var(--color-text-inverse);
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    transition: all 0.3s ease;
}

.footer__text {
    margin: 0;
}

/* ===== СТИЛИ ДЛЯ ДРУГИХ СТРАНИЦ ===== */

/* Новости */
.news-card {
    background: var(--color-bg);
    padding: 25px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-primary);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateX(5px);
}

.news-title {
    font-size: 22px;
    color: var(--color-text);
    margin: 0 0 15px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.news-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

.news-text {
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
}

/* Товары */
.goods-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background: var(--color-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--color-primary);
    transition: all 0.3s ease;
}

.product-name {
    font-size: 18px;
    color: var(--color-text);
    margin: 10px 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.product-price {
    font-size: 16px;
    color: var(--color-primary);
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

/* Контакты */
.contacts-container {
    max-width: 500px;
    margin: 0 auto;
}

.contact-info {
    background: var(--color-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.contact-item {
    margin-bottom: 25px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-title {
    font-size: 16px;
    color: var(--color-text-light);
    margin: 0 0 5px 0;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-detail {
    font-size: 18px;
    color: var(--color-text);
    margin: 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.call-button {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-text-inverse);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.call-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Адаптивность */
@media (max-width: 768px) {
    .profile__card {
        flex-direction: column;
        text-align: center;
    }
    
    .nav__list {
        flex-direction: column;
        gap: 10px;
    }
    
    .projects__grid {
        grid-template-columns: 1fr;
    }
    
    .skills__list {
        flex-direction: column;
        align-items: center;
    }
    
    .theme-toggle {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px auto;
        display: block;
    }
}

/* ===== ТЕМНАЯ ТЕМА ДЛЯ BOOTSTRAP ===== */

[data-theme="dark"] body {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-text);
}

[data-theme="dark"] .bg-light {
    background-color: var(--color-bg-secondary) !important;
    color: var(--color-text);
}

[data-theme="dark"] .card {
    background-color: var(--color-bg);
    border-color: var(--color-bg-secondary);
    color: var(--color-text);
}

[data-theme="dark"] .card-header {
    background-color: var(--color-bg-secondary) !important;
    border-bottom-color: var(--color-bg-secondary);
    color: var(--color-text);
}

[data-theme="dark"] .text-muted {
    color: var(--color-text-light) !important;
}

[data-theme="dark"] .text-primary {
    color: var(--color-primary) !important;
}

[data-theme="dark"] .progress {
    background-color: var(--color-bg-secondary);
}

[data-theme="dark"] .navbar-dark {
    background-color: var(--color-bg-dark) !important;
}

[data-theme="dark"] .bg-primary {
    background-color: var(--color-primary) !important;
}

[data-theme="dark"] .bg-dark {
    background-color: var(--color-bg-dark) !important;
}

[data-theme="dark"] .btn-outline-light {
    color: var(--color-text-inverse);
    border-color: var(--color-text-inverse);
}

[data-theme="dark"] .btn-outline-light:hover {
    background-color: var(--color-text-inverse);
    color: var(--color-bg-dark);
}

[data-theme="dark"] .shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

/* Исправляем цвета для прогресс-баров в темной теме */
[data-theme="dark"] .progress-bar {
    color: white;
}