@charset "UTF-8";

/* ==========================================
   AtlasConvert - Main Styles
   ========================================== */

/* Reset & Base */
html {
    overflow-x: hidden;
}
body {
    overflow-x: hidden;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --primary-hover: #3a7bc8;
    --success-color: #10B981;
    --error-color: #EF4444;
    --text-color: #1F2937;
    --text-secondary: #6B7280;
    --bg-color: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

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

/* ==========================================
   Header
   ========================================== */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 100%;
    /* overflow:visible — необходимо для dropdown меню */
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Burger Menu (Mobile) */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s;
    border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================
   Navigation Menu
   ========================================== */

/* ─── DESKTOP (≥ 769px) ─────────────────── */
.nav-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-grow: 1;
}

.nav-item {
    min-width: 0;
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    line-height: 1.4;
}

/* Nav dropdown arrow */
.nav-item.dropdown > .nav-link::after {
    content: "\25BE";
    font-size: 0.7em;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.2s;
}
.nav-item.dropdown.active > .nav-link::after,
.nav-item.dropdown:hover > .nav-link::after {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .nav-item.dropdown > .nav-link::after {
        content: "\25BC";
        font-size: 0.65em;
    }
}

.nav-link:hover,
.dropdown.active > .nav-link {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* ─── Dropdown панель ─── */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 210px;
    max-height: 75vh;
    overflow-y: auto;
    z-index: 1100;
    padding: 6px 0;
}

/* Двухколоночный dropdown */
.dropdown-menu.two-columns {
    display: none;
    min-width: 430px;
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
    padding: 8px 0;
}

/* Показ при hover на десктопе */
@media (min-width: 769px) {
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
    }
    /* Bridge gap between nav-link and dropdown so hover doesn't break */
    .nav-item.dropdown > .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 0;
        right: 0;
        height: 8px;
        background: transparent;
    }

    .nav-item.dropdown:hover > .dropdown-menu.two-columns {
        display: grid;
    }
    /* На ПК прячем эмодзи в категориях */
    .nav-link > .menu-icon {
        display: none;
    }
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* ─── Language Switcher ─── */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
}
.lang-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    text-decoration: none;
    font-size: 1.2rem;
    transition: border-color 0.2s, transform 0.2s;
}
.lang-flag:hover,
.lang-flag.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* ─── MOBILE (≤ 768px) ─────────────────── */
@media (max-width: 768px) {
    /* Показываем бургер */
    .burger-menu {
        display: flex !important;
    }

    /* Меню скрыто по умолчанию */
    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 9999;
        padding: 4px 0;
    }
    /* Открытое мобильное меню */
    .nav-menu.open,
    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        min-width: 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-item:last-child { border-bottom: none; }

    .nav-link {
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 0;
        justify-content: space-between;
    }
    /* На мобиле показываем иконки */
    .nav-link > .menu-icon { display: inline !important; }

    /* Dropdown — аккордеон */
    .dropdown-menu,
    .dropdown-menu.two-columns {
        display: none !important;
        position: static !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: var(--bg-secondary) !important;
        min-width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        grid-template-columns: 1fr !important;
    }
    /* Открытый аккордеон */
    .nav-item.dropdown.active > .dropdown-menu {
        display: flex !important;
        flex-direction: column !important;
    }
    .nav-item.dropdown.active > .dropdown-menu.two-columns {
        display: flex !important;
        flex-direction: column !important;
    }

    .dropdown-menu a {
        padding: 12px 24px;
        border-top: 1px solid var(--border-color);
        white-space: normal;
        font-size: 0.9rem;
    }

    /* Language switcher на мобиле */
    .language-switcher {
        justify-content: center;
        padding: 12px 0;
        border-top: 2px solid var(--border-color);
        margin-left: 0;
        width: 100%;
    }
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* H1 - CENTERED */
h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ==========================================
   Converter Section
   ========================================== */
.converter-section {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

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

.format-selector {
    margin-bottom: 2rem;
}

.format-selector label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.format-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
}

.convert-button,
.download-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.convert-button:hover,
.download-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.convert-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* File List */
.files-list {
    margin-top: 2rem;
}

.file-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
}

.file-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.file-status.converting {
    background: #FEF3C7;
    color: #92400E;
}

.file-status.completed {
    background: #D1FAE5;
    color: #065F46;
}

.file-status.error {
    background: #FEE2E2;
    color: #991B1B;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.download-all-button {
    margin-top: 1rem;
    background: var(--success-color);
}

.download-all-button:hover {
    background: #059669;
}

/* Error Message */
.error-message {
    background: #FEE2E2;
    color: #991B1B;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--error-color);
}

/* ==========================================
   Ad Blocks
   ========================================== */
.ad-banner-header {
    background: var(--bg-secondary);
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.ad-banner-footer {
    background: var(--bg-secondary);
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.ad-sidebar {
    position: sticky;
    top: 100px;
    margin-left: 2rem;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.footer-right {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-right a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--primary-color);
}

/* ==========================================
   Modal (Language & Cookie)
   ========================================== */
.modal-overlay {
    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: 2000;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-button-primary {
    background: var(--primary-color);
    color: #fff;
}

.modal-button-primary:hover {
    background: var(--primary-hover);
}

.modal-button-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.modal-button-secondary:hover {
    background: var(--border-color);
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    border: 1px solid var(--border-color);
}

.cookie-notice p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.cookie-notice a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-notice-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-notice-button:hover {
    background: var(--primary-hover);
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ==========================================
   How It Works & Why Choose Us blocks
   ========================================== */
.how-it-works,
.why-choose {
    padding: 3rem 0;
    background: var(--bg-secondary);
}

.how-it-works:nth-of-type(odd),
.why-choose:nth-of-type(even) {
    background: #fff;
}

.how-it-works h2,
.why-choose h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.benefit-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.benefit-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.benefit-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.benefit-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .steps-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .how-it-works h2,
    .why-choose h2 {
        font-size: 1.4rem;
    }
}

/* Mobile header fix */
@media (max-width: 768px) {
    .header-content {
        gap: 0.5rem;
        padding: 0.75rem 0;
        flex-wrap: nowrap;
        overflow: visible;   /* NOT hidden — flags must not be clipped */
        min-width: 0;
    }
    .logo {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    .logo a {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .burger-menu {
        flex-shrink: 0;
        order: 2;
    }
    .language-switcher {
        flex-shrink: 0;
        gap: 4px;
        margin-left: 6px;
        order: 3;
        display: flex !important;
        align-items: center;
        /* Override the 100%-width rule from the other 768px block */
        width: auto !important;
        padding: 0 !important;
        border-top: none !important;
        justify-content: flex-end !important;
    }
    .lang-flag {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        flex-shrink: 0;
    }
}
@media (max-width: 360px) {
    .lang-flag {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
    .logo a {
        font-size: 0.95rem;
    }
}

/* Our Tools grid (homepage) */
.our-tools-section {
    padding: 3rem 0;
}

.our-tools-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.our-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.our-tools-category {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.our-tools-category h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.our-tools-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.our-tools-category li {
    padding: 0.2rem 0;
}

.our-tools-category a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.our-tools-category a:hover {
    color: var(--primary-color);
}

/* Mobile footer fix */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .footer-left {
        width: 100%;
        word-break: break-word;
    }
    .footer-right {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    .footer-right a {
        font-size: 0.8rem;
        max-width: 100%;
        word-break: break-word;
    }
    .footer-right a[style*="inline-flex"] {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }
    .footer-right a[style*="inline-flex"] img {
        flex-shrink: 0;
    }
}
@media (max-width: 400px) {
    .footer-right {
        flex-direction: column;
        gap: 0.4rem;
    }
}