/* ========== GLOBAL STYLES ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8f9fa;
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0369a1;
}

/* ========== HEADER & NAVIGATION ========== */

.site-header {
    overflow: visible;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1e293b;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger {
    width: 25px;
    height: 3px;
    background: #0284c7;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: #0284c7;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.nav-dropdown-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 40px);
    max-width: 1200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.dropdown-column h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 0.95rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.dropdown-column a {
    display: block;
    color: #475569;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-column a:hover {
    background: #f1f5f9;
    color: #0284c7;
    padding-left: 1rem;
}

/* Mobile Navigation */
@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        z-index: 999;
    }

    .main-nav.active {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    /* Скрываем большой dropdown-блок на мобильных */
    .nav-dropdown-menu {
        position: static !important;
        transform: none !important;
        min-width: calc(100vw - 40px); max-width: 1200px;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none;
        background: #fafbff;
    }

    .nav-dropdown {
        width: 100%;
        border-bottom: 1px solid #e2e8f0;
    }

    /* Кнопка "Все инструменты" убрана — вместо неё показываем колонки как категории */
    .nav-dropdown-toggle {
        display: none !important;
    }

    /* Каждая колонка = раскрываемая категория */
    .dropdown-columns {
        display: flex !important;
        flex-direction: column;
        gap: 0;
    }

    .dropdown-column {
        border-bottom: 1px solid #e8eaf6;
    }

    /* Заголовок категории — кнопка раскрытия */
    .dropdown-column h4 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0;
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        cursor: pointer;
        user-select: none;
        border-bottom: none;
        transition: background 0.2s;
    }
    .dropdown-column h4:hover {
        background: #f1f5f9;
    }
    .dropdown-column h4::after {
        content: '▼';
        font-size: 10px;
        color: #94a3b8;
        transition: transform 0.25s;
        flex-shrink: 0;
    }
    .dropdown-column.open h4::after {
        transform: rotate(180deg);
    }

    /* Ссылки внутри категории — скрыты по умолчанию */
    .dropdown-column .cat-links {
        display: none;
        padding: 0 0 8px 0;
        background: white;
    }
    .dropdown-column.open .cat-links {
        display: block;
    }

    .dropdown-column a {
        display: block;
        padding: 10px 30px;
        font-size: 14px;
        color: #475569;
        border-left: 3px solid transparent;
        transition: all 0.15s;
    }
    .dropdown-column a:hover {
        background: #f1f5f9;
        color: #0284c7;
        border-left-color: #0284c7;
        padding-left: 34px;
    }

    /* Мобильный блок "Все инструменты" — показываем dropdown-menu сразу */
    .main-nav.active .nav-dropdown-menu {
        display: block;
    }

    .nav-link {
        padding: 14px 20px;
        border-top: 1px solid #e2e8f0;
        font-size: 15px;
    }
}

/* ========== BUTTONS ========== */

.btn-primary {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 1rem 2rem;
    background: white;
    color: #0284c7;
    border: 2px solid #0284c7;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #0284c7;
    color: white;
}

.btn-copy {
    padding: 0.75rem 1.5rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-copy:hover {
    background: #059669;
}

.btn-export {
    padding: 0.75rem 1.5rem;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-export:hover {
    background: #7c3aed;
}

/* ========== FORM ELEMENTS ========== */

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #0284c7;
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
}

.hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.required {
    color: #ef4444;
}

/* ========== LOADING SPINNER ========== */

.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== TOOL PAGES ========== */

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    font-size: 1.2rem;
    color: #64748b;
}

.tool-content {
    margin-bottom: 3rem;
}

.tool-info {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-info h2 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.tool-info h3 {
    color: #475569;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.tool-info ul {
    margin-left: 2rem;
}

.tool-info li {
    margin-bottom: 0.5rem;
}

.info-box,
.warning-box {
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
    margin: 1.5rem 0;
}

.info-box {
    background: #dbeafe;
    border-color: #0284c7;
}

.warning-box {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* ========== FOOTER ========== */

.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin: 0 0 1rem 0;
    color: #06b6d4;
    font-size: 1.2rem;
}

.footer-section p {
    margin: 0.5rem 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.footer-section a {
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #06b6d4;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ========== COOKIE CONSENT ========== */

.cookie-consent {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    display: none; /* Скрыто по умолчанию */
}

@keyframes slideIn {
    from {
        transform: translateX(500px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cookie-content p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #475569;
}

.cookie-content a {
    color: #0284c7;
}

.btn-accept {
    width: 100%;
    padding: 0.75rem;
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-accept:hover {
    background: #0369a1;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .header-container {
        padding: 1rem;
    }

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

    .cookie-consent {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* ========== 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; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* SEO Promo в футере */
.seo-promo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.seo-promo:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.seo-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Одинаковая высота для заголовков категорий */
.dropdown-column h4 {
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* ===== FAQ Block ===== */
.faq-block {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
/* When faq-block is inside tool-main (already constrained), no extra limiting needed */
.tool-main .faq-block {
    max-width: none;
}
