:root {
    /* Темная тема ( по умолчанию )*/

    --bg-body: #050505;
    --bg-card: #000000;
    --text-main: #ffffff;
    --border-color: gold;
}

body.light-theme {
    /* Светлая тема (переопределяем значения) */
    --bg-body: #ffffff;
    --bg-card: #f0f0f0;
    --text-main: #333333;
    --border-color: #000000;
}

/* =========================================
   1. БАЗОВЫЕ НАСТРОЙКИ (RESET & MAIN)
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: black;
    font-family: 'Montserrat', sans-serif;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Убирает горизонтальную прокрутку */
}

/* Ссылки */
a {
    text-decoration: none;
    color: inherit;
}

/* Заголовки и текст */
h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 32px;
}

h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: gold;
}

p {
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.6;
    color: #cccccc;
}

/* =========================================
   2. КОМПОНЕНТЫ (Кнопки, Контейнеры)
   ========================================= */
.btn {
    background-color: gold;
    color: black;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: inline-block;
}

.btn:hover {
    background-color: white;
    color: black;
    transform: scale(1.1);
    box-shadow: 0 0 15px gold;
}

/* Контейнер "Обо мне" */
.container {
    background-color: #222;
    width: 90%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    
    /* Отступ сверху */
    margin-top: 160px; 
    
    position: relative;
    z-index: 1;
}

/* Аватарка */
.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid gold;
    object-fit: cover;
    transition: 0.5s;
    margin-top: -55px;
    margin-bottom: 10px;
}

@keyframes goldPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0 ,0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.avatar:hover {
    transform: rotate(5deg) scale(1.05);
    border-color: white;
    animation: goldPulse 1.5s infinite;
}

/* =========================================
   3. ШАПКА И ФУТЕР
   ========================================= */
.header {
    background-color: #111;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.logo {
    font-weight: bold;
    font-size: 24px;
    color: gold;
}

.nav-link {
    color: white;
    margin-left: 20px;
    font-weight: bold;
    transition: 0.3s;
    text-decoration: none;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: gold;
    transition: width 0.3 ease;
}

.nav-link:hover:after {
    width: 100%;
}

.nav-link:hover {
    color: gold;
}

footer {
    background-color: DimGrey;
    font-weight: bold;
    font-size: 15px;
    padding: 10px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

/* =========================================
   4. СВЕТЛАЯ ТЕМА (ИСПРАВЛЕНИЕ ЦВЕТОВ)
   ========================================= */
/* Кнопка переключения */
#theme-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s;
}

/* Основные стили светлой темы */
body.light-theme {
    background-color: #f0f2f5;
    color: black;
}

body.light-theme .header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0, 0.1);
}

body.light-theme .nav-link {
    color: #333;
}

body.light-theme .nav-link:hover {
    color: black;
}

body.light-theme .container {
    background-color: #ffffff;
    color: black;
    box-shadow: 0 10px 30px rgba(0,0,0, 0.1);
}

/* Текст в светлой теме */
body.light-theme p {
    color: black !important;
}

body.light-theme h1, 
body.light-theme h2 {
    color: black !important;
    text-shadow: none;
}

body.light-theme .project-card {
    background-color: #ffffff;
    border: 2px solid #333;
    color: black;
}

body.light-theme .project-card h3 {
    color: #d4af37;
}

body.light-theme .project-card p {
    color: black !important;
}

body.light-theme footer {
    background-color: #e0e0e0;
    color: #333;
}

body.light-theme .shop-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .shop-header a {
    color: #333;
}

body.ligth-theme .shop-header .logo {
    color: #d4af37;
}

body.light-theme .product-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    color: #000000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

body.light-theme .product-card h3 {
    color: #000000;
}

body.light-theme .product-card .price {
    color: #000000;
    font-weigth: 800;
}

body.light-theme .product-card p {
    color: #555555 !important;
}

body.light-theme .size-select {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ccc;
}

body.light-theme .product-card button {
    background-color: #d4af37;
    color: #000;
}

body.light-theme .product-card button:hover {
    background-color: #333;
    color: #fff;
}

/* =========================================
   5. ПРОЕКТЫ (СЕТКА)
   ========================================= */
.project-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.project-card {
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 15px;
    width: 300px;
    text-align: center;
    border: 2px solid #333;
    transition: 0.3s;
    
    position: relative; 
    z-index: 1; 
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: gold;
    z-index: 100 !important; 
    box-shadow: 0 10px 40px rgba(0,0,0, 0.5);
}

.project-card h3 {
    color: gold;
    margin-bottom: 10px;
}

.project-card button,
.project-card a {
    background-color: gold;
    color: black;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
    display: inline-block;
}

.project-card button:hover,
.project-card a:hover {
    background-color: white;
    transform: scale(1.05);
    color: black;
}

/* =========================================
   6. GOOGLE CLONE
   ========================================= */
.google-header {
    text-align: right;
    padding: 20px;
}

.google-header a {
    margin-right: 15px;
    font-size: 14px;
}

.google-header .back-btn {
    padding: 8px 15px;
    font-size: 14px;
}

.google-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
}

.google-logo {
    font-size: 90px;
    font-weight: bold;
    margin-bottom: 30px;
    letter-spacing: -5px;
}

.search-input {
    width: 100%;
    max-width: 580px;
    padding: 15px 25px;
    border-radius: 30px;
    border: 1px solid #5f6368;
    background-color: transparent;
    color: inherit;
    font-size: 16px;
    margin-bottom: 30px;
    outline: none;
}

.search-input:focus {
    background-color: #303134;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    border-color: transparent;
}

.google-buttons button {
    background-color: #303134;
    border: 1px solid #303134;
    color: #e8eaed;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
}

body.light-theme .search-input {
    background-color: #fff;
    border: 1px solid #dfe1e5;
}

body.light-theme .google-buttons button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    color: #3c4043;
}

/* Анимация букв Google */
@keyframes jump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.google-logo span {
    display: inline-block;
    transition: transform 0.2s;
    cursor: default;
}

.google-logo span:hover {
    animation: jump 0.6s ease infinite;
    color: gold !important;
}

/* =========================================
   7. МАГАЗИН (SHOP)
   ========================================= */
.shop-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 40px; 
    background-color: #111; 
    border-bottom: 1px solid #333; 
}

.shop-header a { 
    font-size: 18px; 
    margin-left: 30px; 
    transition: 0.3s; 
}

.shop-header .logo { 
    color: gold; 
    font-weight: bold; 
    font-size: 24px; 
    margin-left: 0; 
    text-transform: uppercase; 
}

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

.shop-container h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 36px;
    color: gold;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.product-card h3 {
    margin: 10px 0;
    font-size: 20px;
}

.product-card .price {
    font-size: 18px;
    font-weight: bold;
    color: #ddd;
    margin-bottom: 15px;
}

.size-select {
    background-color: #333;
    color: white;
    border: 1px solid gold;
    padding: 5px;
    border-radius: 5px;
    margin-bottom: 10px;
    width: 100%;
    cursor: pointer;
}

.product-card button {
    background-color: gold;
    color: black;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: 0.3s;
}

.empty-message,
.order-btn {
    display: none;
}

.order-btn {
    margin: 40px auto;
    background: gold;
    padding: 15px 30px;
    font-weight: bold;
    border-radius: 10px;
}

.delete-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.total-price {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
}

#cart-items .product-card {
    margin-bottom: 30px;
}

/* =========================================
   8. МАТРИЦА (ФИНАЛЬНЫЕ ИСПРАВЛЕНИЯ)
   ========================================= */

/* Специальный класс для body на странице матрицы */
.matrix-body {
    margin: 0;
    overflow: hidden; /* Убирает скролл на странице матрицы */
    background-color: black;
    /* Убираем flex, чтобы canvas нормально позиционировался */
    display: block; 
}

/* ВАЖНОЕ ИСПРАВЛЕНИЕ: 
   Мы применяем стили к canvas ТОЛЬКО внутри .matrix-body.
   Это чтобы canvas не ломал другие страницы, если он там случайно появится.
   И ставим position: fixed, чтобы он был фоном и ничего не сдвигал.
*/
.matrix-body canvas {
    display: block;
    position: fixed; /* Жестко фиксируем на фоне */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* Самый нижний слой */
}

/* Кнопка "Назад" - ПРИКЛЕЕНА ПОВЕРХ ВСЕГО */
.matrix-back {
    position: fixed; 
    top: 20px;
    left: 20px;
    
    color: #0F0;
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #0F0;
    
    padding: 10px 20px;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 18px;
    
    /* Ставим z-index больше, чем у canvas (100 > 1) */
    z-index: 100; 
    transition: 0.3s;
}

.matrix-back:hover {
    background-color: #0F0;
    color: black;
    box-shadow: 0 0 20px #0F0;
}

/* Хакерская карточка в проектах (Черная с зеленым) */
.hacker-card {
    background-color: black !important;
    border: 1px solid #0F0 !important;
    box-shadow: 0 0 5px #0F0;
}

.hacker-card h3 {
    color: #0F0 !important;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    text-shadow: 0 0 5px #0F0;
}

.hacker-card p {
    color: #0F0 !important;
    font-family: monospace;
    opacity: 0.8;
}

.hacker-card a {
    background-color: transparent !important;
    border: 1px solid #0F0 !important;
    color: #0F0 !important;
}

.hacker-card a:hover {
    background-color: #0F0 !important;
    color: black !important;
    box-shadow: 0 0 15px #0F0;
}

/* Исправление белой темы в шритфе блока матрицы*/

body.light-theme .hacker-card p,
body.light-theme .hacker-card {
    color: #00ff41 !important;
}

/* === Новые анимации === */

.product-card {
    overflow: hidden;
}

.product-card img {
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.04);
}

/* =========================================
   9. КОНТАКТЫ (CONTACTS PAGE)
   ========================================= */

/* Центрируем блок на странице */
.contact-container {
    max-width: 600px;
    margin: 120px auto 40px; /* Отступ сверху побольше, так как хедер фиксированный */
    padding: 40px;
    background-color: #1a1a1a;
    border-radius: 20px;
    border: 1px solid #333;
    text-align: center;
    box-shadow: 0 0 20px rba(0, 0, 0,0.5);
}

.contact-container h1 {
    color: gold;
    margin-bottom: 10px;
}

/* Кнопки соцсетей */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0; 
}

.social-btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid #444;
    transition: 0.3s;
    background: #222;
    color: white;
}

.social-btn:hover {
    border-color: gold;
    color: gold;
    transform: translateY(-3px);
}

/* Поля формы */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    background-color: #111;
    border: 1px solid #444;
    color: white;
    font-family: 'Montserrat' , sans-serif;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

/* Эффект при клике на поле ввода */
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: gold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* Кнопка отправки на всю ширину */
.contact-form .btn {
    width: 100%;
    margin-top: 10px;
}

/* =========================================
   10. КОНТАКТЫ (СВЕТЛАЯ ТЕМА)
   ========================================= */

/* 1. Сам блок контактов становится белым */
body.light-theme .contact-container {
    background-color: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    color: black;
}

/* 2. Заголовок имени делаем черным */
body.light-theme .contact-container h1 {
    color: black;
}

/* 3. Кнопки соцсетей */
body.light-theme .social-btn {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

body.light-theme .social-btn:hover {
    background-color: white;
    color: #d4af37; /* При наведении - золото */
    border-color: #d4af37;
}

/* 4. Поля ввода */
body.light-theme .contact-form input,
body.light-theme .contact-form textarea {
    background-color: #f9f9f9;
    color: black;
    border-color: #ccc;
}

body.light-theme .contact-form input:focus,
body.light-theme .contact-form textarea:focus {
    background-color: white;
    border-color: #d4af37;
} 

/* Глобальные настройки люкса */

/* Плавная прокрутка*/

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: #FFD700;
    color: #000000;
}

::-moz-selection {
    background-color: #FFD700;
    color: #000000;
}

/* Эффект нажатия на кнопку */

button:active, 
.btn:active,
.project-card a:active,
.hacker-card a:active,
.social-links a:active{
    transform: scale(0.95);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* Кастомный скроллбар */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
 background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background-color: #FFD700;
    border-radius: 6px;
    border: 3px solid #1a1a1a;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #ffea00;
}

/* Кастомный скроллбар белая тема*/

body.light-theme::-webkit-scrollbar-track {
    background: #ffffff;
}

body.light-theme::-webkit-scrollbar-thumb {
    background-color: #FFD700;
    border: 3px solid #FFFFFF;
}

body.light-theme::-webkit-scrollbar-thumb:hover {
    background-color: #e6c200;
}

/* Стили для корзины */

#cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

#cart-items .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
}

.item-info {
    flex-grow: 1;
    margin-left: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-info h3,
.item-info p,
.item-info .price {
    margin: 0;
}

.item-info h3 {
    font-size: 20px;
    color: gold;
}

#cart-items .product-card img {
    width: 120px;
    heigth: 120px;
    object-fit: cover;
    margin-right: 25px;
    border-radius: 10px;
    flex-shrink: 0;
    border: 2px solid gold;
}

#cart-items .product-card h3 {
    font-size: 18px;
    margin: 0 0 5px 0;
}

#cart-items .delete-btn {
    background-color: #ff4444;
    color: white;
    width: auto;
    padding: 10px 20px;
    margin-top: 0;
    margin-left: auto;
}

#cart-items .delete-btn:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

/* Адаптация мобилка корзина */

@media (max-width: 600px) {
    #card-items .product-card {
        flex-direction: column;
        text-align: center;
    }
    #cart-items .product-card img {
        margin-rigth: 0;
        margin-bottom: 10px;
    }
    #cart-items .delete-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* ВИДЖЕТЫ */

/* Боковая крипто-панель */

.crypto-sidebar {
    position: fixed;  /* Коробка приклеена к экрану */
    top: 70px;       /* Отступ сверху */
    left: 20px;       /* Отступ слева */
    z-index: 100;     /* Поверх всех */
    
    /* Магия столбика: */
    display: flex; 
    flex-direction: column; /* Выстроить детей в колонну */
    gap: 15px;              /* Расстояние между монетками */
}

/* --- 2. САМА МОНЕТКА (ВИДЖЕТ) --- */
.crypto-widget {
    /* ВАЖНО: Тут НЕ должно быть position: absolute! */
    position: relative; /* Или вообще удали position */
    
    background-color: var(--bg-card); /* <--- Магия здесь */
    color: var(--border-color);       /* Используем цвет рамки для текста (золото/серый) */
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    width: 200px; /* Фиксированная ширина */
    
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    
    box-shadow: 0 4px 10px rgba(0,0,0, 0.5);
    transition: transform 0.2s;
}

.crypto-widget:hover {
    transform: scale(1.05);
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform:translateX(0px); }
}

/* Белая тема биткоина */

body.light-theme .crypto-widget {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.light-theme .crypto-widget:hover {
    background-color: #f9f9f9;
}

/* Адаптация мобилка главная */

@media (max-width: 768px) {

    /* Шапка */

    .header {
        position: relative;
        z-index: 1000;
        background-color: #000;

        flex-direction: column;
        heigth: auto;
        padding: 15px 0;
    }

    .header nav {
        margin-top: 15px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    /* Крипто-панель */

    .crypto-sidebar {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 15px 10px;
        background-color: var(--bg-body); /* Пусть совпадает с фоном сайта */
        border-bottom: 1px solid var(--border-color);
        z-index: 1;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    /* Настройка самих карточек монет для телефона */

    .crypto-widget {
        min-width: 100px;
        margin-right: 10px;
        font-size: 12px;
        padding: 8px;
    }

    /* Скрывает скролл бар */

    .crypto-sidebar::-webkit-scrollbar {
        display: none;
    }

    /* Контент */

    .container {
        width: 90%;
        margin-top: 10px;
        padding-bottom: 50px;
    }

    h1 {
        font-size: 28px;
    }
}

/* Контакты мобилка горизонтальный скролл */

.social-links {
        display: flex;           /* Выстраиваем в ряд */
        flex-wrap: nowrap;       /* Запрещаем перенос на новую строку */
        overflow-x: auto;        /* Разрешаем скролл влево-вправо */
        gap: 15px;               /* Отступы между кнопками */
        padding: 5px 5px;    /* Место снизу (на всякий случай) */
       /* justify-content: flex-start; /* Начинаем слева */ /* ебучая хуйня из-за которой у меня было не красиво видно на широких экранах кнопки */
        
        /* === МАГИЯ: СКРЫВАЕМ ПОЛЗУНОК === */
        
        /* 1. Для Chrome, Safari и Opera */
        &::-webkit-scrollbar {
            display: none;
        }

        /* 2. Для IE и старого Edge */
        -ms-overflow-style: none;

        /* 3. Для Firefox */
        scrollbar-width: none;
    }

    /* Чтобы кнопки не сжимались, если экран узкий */
    .social-btn {
        min-width: 120px; /* Фиксированный размер кнопки */
        white-space: nowrap; /* Текст в одну строку */
    }


