/* Обновленные стили для красивого минимализма */
:root {
    --primary: #8f5db6;
    --primary-dark: #7a4a9d;
    --secondary: #666666;
    --background: #ffffff;
    --surface: #ffffff;
    --border: #d0d0d0;
    --text: #000000;
    --text-light: #666666;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    min-height: 100vh;
}

/* Обновленная шапка */
header {
    background: var(--surface);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'EPSON True Regular Script Medium', 'Times New Roman', serif;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(143, 93, 182, 0.1);
    border: 1px solid var(--border);
}

.auth-link {
    background: var(--primary);
    color: white !important;
    border: 1px solid var(--primary) !important;
}

.auth-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.language-selector select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
}

/* Обновленный основной контент */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 2rem;
    background: var(--surface);
    border-radius: 16px;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-light);
    font-weight: 400;
}

.timer-display {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Обновленные категории инструментов - квадратные по 3 в ряд */
.tools-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.category-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: block;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border: 2px solid var(--primary);
}

.category-card h2 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.category-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

/* Стили для страницы чтения файлов */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.container h1 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--text);
    font-weight: 700;
    text-align: center;
}

.folder-selector {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: var(--surface);
    border-radius: 16px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

#add-pair {
    background: var(--secondary);
}

#add-pair:hover {
    background: #555;
}

.remove-pair {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-pair:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.text-pairs {
    margin: 2.5rem 0;
    padding: 2rem;
    background: var(--surface);
    border-radius: 16px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.text-pairs h3 {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.text-pair {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.text-pair input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
}

.text-pair input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(143, 93, 182, 0.1);
}

.status {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.status div {
    margin-bottom: 0.5rem;
}

progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background-color: var(--border);
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background-color: var(--primary);
    border-radius: 4px;
}

.hidden {
    display: none;
}

#selected-folder {
    margin-left: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Подвал */
footer {
    background: var(--surface);
    border-top: 2px solid var(--primary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .tools-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .category-card {
        padding: 2rem;
    }
    
    .text-pair {
        flex-direction: column;
        align-items: stretch;
    }
    
    .remove-pair {
        align-self: flex-end;
        width: fit-content;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Стили для модального окна маппинга */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
}

.mapping-table {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.mapping-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--primary);
    color: white;
    padding: 1rem;
    font-weight: 600;
}

.mapping-body {
    max-height: 400px;
    overflow-y: auto;
}

.mapping-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.mapping-row:last-child {
    border-bottom: none;
}

.mapping-row select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

@media (max-width: 480px) {
    .tools-categories {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }
    
    .folder-selector,
    .text-pairs {
        padding: 1.5rem;
    }
}

/* Стили для CRM системы */
.data-blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.data-block {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.data-block h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.block-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.field-group input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text);
    transition: all 0.3s ease;
}

.field-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(143, 93, 182, 0.1);
}

.field-group input:read-only {
    background: #f5f5f5;
    color: var(--text-light);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 1rem;
}

.hidden {
    display: none;
}

.grid-cols-2 {
    grid-template-columns: 1fr 1fr;
}

/* Адаптивность для CRM */
@media (max-width: 768px) {
    .data-blocks {
        grid-template-columns: 1fr;
    }
    
    .block-content {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Стили для поиска в CRM */
.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 1rem;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-result-item:hover {
    background-color: rgba(143, 93, 182, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item span {
    margin-right: 1rem;
    font-weight: 500;
}

/* Стили для file input */
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    background: rgba(143, 93, 182, 0.1);
    border-color: var(--primary-dark);
}

input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Для Safari и старых браузеров */
input[type="file"]::-webkit-file-upload-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
/* Тёмная тема */
[data-theme="dark"] {
    --primary: #9f7fbf;
    --primary-dark: #8a6bac;
    --secondary: #888888;
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --border: #404040;
    --text: #ffffff;
    --text-light: #b0b0b0;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Дополнительные стили для тёмной темы */
[data-theme="dark"] .field-group input:read-only {
    background: #3a3a3a;
    color: var(--text-light);
}

[data-theme="dark"] progress::-webkit-progress-bar {
    background-color: var(--border);
}

[data-theme="dark"] input[type="file"] {
    background: var(--surface);
    color: var(--text);
}

/* Стили для переключателя темы */
.theme-toggle .nav-link {
    padding: 0.5rem !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.theme-toggle .nav-link:hover {
    background: rgba(143, 93, 182, 0.1);
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Стили для форм авторизации в тёмной теме */
[data-theme="dark"] .auth-container {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] .form-group input {
    background: var(--background);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .form-group label {
    color: var(--text);
}

[data-theme="dark"] .auth-links p,
[data-theme="dark"] .auth-links a {
    color: var(--text-light);
}

[data-theme="dark"] .auth-links a:hover {
    color: var(--primary);
}

[data-theme="dark"] h2 {
    color: var(--text);
}
/* Стили для кнопок-ссылок в формах авторизации */
.auth-links .auth-button {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all 0.3s ease;
}

.auth-links .auth-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

[data-theme="dark"] .auth-links .auth-button {
    background: var(--primary);
    color: white;
}

/* Стили для меню пользователя */
.user-menu {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px; /* Увеличили с 280px до 320px */
    box-shadow: var(--shadow-hover);
    z-index: 1001;
    margin-top: 0.5rem;
}

.dropdown-menu .user-email {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-menu .menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-menu .menu-item:hover {
    background: rgba(143, 93, 182, 0.1);
    border-color: var(--primary);
}

.dropdown-menu .premium-status {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    font-weight: 600;
    border: none;
}

/* Перемещение auth-section в правый угол */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#auth-section {
    margin-left: auto; /* Прижимает к правому краю */
}

/* Убедимся, что выпадающее меню не перекрывается */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px; /* Увеличили с 280px до 320px */
    box-shadow: var(--shadow-hover);
    z-index: 1001;
    margin-top: 0.5rem;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #auth-section {
        margin-left: 0;
        order: 3; /* Перемещает в конец на мобильных */
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#auth-section {
    margin-left: auto;
}

/* Стили для страницы подписки */
.subscription-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.subscription-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 400px;
    position: relative;
}

.subscription-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.subscription-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.subscription-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text);
    margin: 1.5rem 0;
    text-align: center;
    line-height: 1.2;
}

.subscription-price span:first-child {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subscription-price span:last-child {
    display: block;
    font-size: 1rem;
    font-weight: normal;
    color: var(--text-light);
}

.subscription-features {
    flex-grow: 1;
    margin: 1rem 0;
}

/* Адаптивность для подписки */
@media (max-width: 1200px) {
    .subscription-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        padding: 0 1rem;
    }
    
    .subscription-card {
        min-height: auto;
        padding: 1.5rem;
    }
}

/* Обновленные стили для подвала */
.footer-links {
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.footer-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-row a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0;
    transition: all 0.3s ease;
    text-align: left;
}

.footer-row a:hover {
    color: var(--primary);
    padding-left: 0.3rem;
}

/* Стили для контентных блоков на информационных страницах */
.content-block {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    border: 2px solid var(--primary);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.content-text {
    line-height: 1.7;
    color: var(--text);
}

.content-text h2 {
    color: var(--primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.4rem;
}

.content-text h2:first-child {
    margin-top: 0;
}

.content-text p {
    margin-bottom: 1rem;
}

.content-text ul, .content-text ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.content-text li {
    margin-bottom: 0.5rem;
}

/* Стили для рекламных блоков */
.ad-sidebar {
    position: fixed;
    top: 140px;
    width: 300px;
    height: 600px;
    z-index: 99;
}

.ad-left {
    left: 20px;
}

.ad-right {
    right: 20px;
}

/* Скрыть на мобильных */
@media (max-width: 1023px) {
    .ad-sidebar {
        display: none;
    }
}

/* Стили для модального окна ограничений */
.limit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.limit-modal-content {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hover);
    border: 2px solid var(--primary);
    text-align: center;
}

.limit-modal h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.limit-modal p {
    color: var(--text);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.limit-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.limit-modal-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.limit-modal-primary {
    background: var(--primary);
    color: white;
}

.limit-modal-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.limit-modal-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
}

.limit-modal-secondary:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

