/* -------- 1. Design Tokens (CSS Variables) -------- */
:root {
    --bg-main: #101823;          /* CoinMarketCap background */
    --bg-card: #131722;         /* Cards, tables, toolbars */
    --lightdark: #1B263B;       /* Hover highlight color */
    --border-card: #1e2533;     /* Card borders & table row separators */
    --text-primary: #ffffff;    /* Main foreground text */
    --text-secondary: #808a9d;  /* Secondary, muted text */
    --accent: #2e62f1;          /* Primary action colour */
    --accent-hover: #4b7dff;    /* Hover state for primary */
    --positive: #16c784;        /* Positive values */
    --negative: #EA3943;        /* Negative values */
    --neutral: #ffffff;         /* Neutral text */
    --shadow-card: 0 4px 20px rgba(0,0,0,0.25);
    --dark-row: #1e2533;
    --hover-row: #2e62f1;
    --border: rgba(0, 0, 0, 0.05);
    --border-light: #2e62f1;
    --text-shadow-color: rgba(0, 0, 0, 0.8); /* Тень для светлого текста в темной теме */
    --text-shadow-color-light: rgba(255, 255, 255, 0.8); /* Тень для темного текста в светлой теме */
    --text-shadow-color-dark: rgba(0, 0, 0, 0.2); /* Тень для темного текста в темной теме */
}

/* -------- Светлая тема -------- */
body.light-theme {
    --bg-main: #ffffff;
    --bg-card: #f7f8fa;
    --lightdark: #e4e6eb;
    --border-card: #e8ebef;
    --text-primary: #0e1116;
    --text-secondary: #646d7a;
}

/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'segoe ui', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    cursor: pointer;
    user-select: none;
}

.btn:hover {
    background-color: var(--accent-hover);
    filter: brightness(1.1);
}

.btn-large {
    padding: 12px 30px;
    font-size: 18px;
}

.btn-outline {
    border: 1px solid var(--border-card);
    background: transparent;
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--lightdark);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

/* Хедер */
header {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-card);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

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

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

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    padding-top: 2px;
}

.logo-text-main {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

.logo-text-sub {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

nav ul {
    display: flex;
    list-style-type: none;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

#login-btn {
    margin-left: 5px;
    font-weight: 500;
    height: 32px;
    box-sizing: border-box;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

/* Переключатель темы */
.btn-sm {
    padding: 0 12px;
    font-size: 14px;
    height: 32px;
    line-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    box-sizing: border-box;
    margin: 0;
    border-width: 1px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    color: var(--text-secondary);
    padding: 0;
    margin: 0;
}

.theme-toggle:hover {
    background-color: var(--lightdark);
    color: var(--text-primary);
}

nav ul li a:hover {
    color: var(--accent);
}

/* Секция герой */
.hero {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 180px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.1;
}

.hero::before {
    background: var(--accent);
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    filter: blur(60px);
}

.hero::after {
    background: var(--accent-hover);
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    filter: blur(50px);
}

/* Позиционирование контейнера */

/* Ставим контент над затемнением */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 52px;
    margin-bottom: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 800;
    line-height: 1.2;
    position: relative;
    z-index: 3;
}

.hero h1 span {
    color: var(--accent);
    position: relative;
    display: inline-block;
}

.hero h1 span::after {
    content: '';
    position: absolute;
    height: 8px;
    background: var(--accent);
    width: 100%;
    bottom: 5px;
    left: 0;
    opacity: 0.2;
    z-index: -1;
}

.hero p {
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 3;
}

/* Секция возможности */
.features {
    padding: 80px 0;
    background-color: var(--bg-card);
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--bg-main);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s;
    border: 1px solid var(--border-card);
}

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

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--accent);
}

/* Секция о системе */
.about {
    padding: 80px 0;
    background-color: var(--bg-main);
}

.about h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
}

.about p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 20px;
    font-size: 18px;
}

/* Футер */
footer {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 40px 0 20px;
    text-align: center;
    border-top: 1px solid var(--border-card);
}

/* Стили для иконок в секции "Возможности" */
.feature-icon {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto; /* Центрирование и нижний отступ */
}

.feature-icon img {
    width: 32px;
    height: 32px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-card);
    position: relative;
    color: var(--text-primary);
    border: 1px solid var(--border-card);
}

.close, .close-register {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover, .close-register:hover {
    color: #333;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.form-switch a {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.form-switch a:hover {
    color: #0052a3;
}

.modal h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-card);
    border-radius: 4px;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.form-error {
    color: #e74c3c;
    margin-bottom: 15px;
    min-height: 20px;
    text-align: center;
}

/* Адаптивная верстка */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
}
