/* =========================
   Tailori Design System
   ========================= */
:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --success-500: #10b981;
    --warning-500: #f59e0b;
    --error-500: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.2s ease-in-out;
}

/* =========================
   Reset & Base Styles
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================
   Utility Classes
   ========================= */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   Header Styles
   ========================= */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--gray-200);
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

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

.main-nav a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-600);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: var(--transition);
}

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

/* Header Meta */
.header-meta {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

/* =========================
   Search Section
   ========================= */
.search-section {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--gray-50) 100%);
}

.search-box {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.search-label {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--radius-xl);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

#searchInput {
    flex: 1;
    padding: 1.25rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    outline: none;
    color: var(--gray-900);
}

#searchInput::placeholder {
    color: var(--gray-500);
}

#generateBtn {
    padding: 1.25rem 2.5rem;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    justify-content: center;
}

#generateBtn:hover:not(:disabled) {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

#generateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

#generateBtn.loading .btn-spinner {
    display: block;
}

.search-subcopy {
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Example Queries */
.example-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 3.5rem;
}

.example-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.example-query {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.example-query:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
    transform: translateY(-1px);
}

/* Search Steps */
.search-steps-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.search-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-500);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* =========================
   Content Area - EXPANDED
   ========================= */
.content-area {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Empty State - EXPANDED */
.empty-state {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.empty-copy h2 {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.empty-copy p {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.empty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
}

.empty-card {
    padding: 2.5rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    text-align: left;
    height: 100%;
}

.empty-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.empty-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.empty-card p {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

/* =========================
   Article Layout - EXPANDED
   ========================= */
.article-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.article-container.with-offers {
    grid-template-columns: 3fr 1fr;
}

.generated-article {
    background: white;
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--gray-800);
    max-width: none;
}

.article-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 2.5rem 0 1.25rem;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 2rem 0 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    max-width: none;
}

.article-content ul, .article-content ol {
    margin: 1.25rem 0 2rem 2.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

.article-content strong {
    font-weight: 600;
    color: var(--gray-900);
}

.article-content a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
}

.article-content a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-600);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-400);
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

/* =========================
   Offers Sidebar
   ========================= */
.offers-sidebar {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 2rem;
    align-self: start;
}

.offers-sidebar h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.offers-sidebar p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.offers-empty {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.offer-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.offer-card:hover {
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.offer-card strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.offer-card span {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.promo-code {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--success-500);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.offer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-500);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 1rem;
    transition: var(--transition);
    width: 100%;
}

.offer-link:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
}

/* =========================
   Info Sections - EXPANDED
   ========================= */
.info-section {
    padding: 5rem 2rem;
}

.info-section--alt {
    background: var(--gray-50);
}

.info-section--about {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--gray-50) 100%);
}

.info-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.info-inner--narrow {
    max-width: 900px;
}

.info-section h2 {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 2rem;
}

.info-lead {
    font-size: 1.25rem;
    color: var(--gray-600);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.info-grid--steps {
    grid-template-columns: repeat(3, 1fr);
}

.info-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    text-align: center;
    height: 100%;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.info-step-label {
    width: 40px;
    height: 40px;
    background: var(--primary-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.info-card h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
}

.info-card p {
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 1rem;
}

/* =========================
   Affiliate Banner
   ========================= */
.affiliate-banner {
    padding: 2rem;
    background: var(--gray-100);
}

.affiliate-inner {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--warning-500);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.affiliate-inner p {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

/* =========================
   Footer - EXPANDED
   ========================= */
.site-footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 2rem 2rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--gray-400);
    line-height: 1.5;
    font-size: 1rem;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.footer-column h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column a {
    display: block;
    color: var(--gray-300);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-column a:hover {
    color: white;
}

.footer-pill {
    display: inline-block;
    background: var(--primary-500);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================
   Responsive Design
   ========================= */
@media (max-width: 1200px) {
    .content-area {
        max-width: 1100px;
        padding: 3rem 1.5rem;
    }
    
    .empty-copy h2 {
        font-size: 2.5rem;
    }
    
    .article-container.with-offers {
        grid-template-columns: 2.5fr 1fr;
    }
}

@media (max-width: 1024px) {
    .content-area {
        max-width: 1000px;
    }
    
    .empty-grid,
    .info-grid,
    .info-grid--steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-container.with-offers {
        grid-template-columns: 1fr;
    }
    
    .offers-sidebar {
        position: static;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav {
        justify-content: center;
    }
    
    .search-section {
        padding: 3rem 1rem;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-steps-strip {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        max-width: 100%;
        padding: 2rem 1rem;
    }
    
    .empty-copy h2 {
        font-size: 2rem;
    }
    
    .empty-copy p {
        font-size: 1.125rem;
    }
    
    .empty-grid,
    .info-grid,
    .info-grid--steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .empty-card,
    .info-card {
        padding: 2rem 1.5rem;
    }
    
    .info-section {
        padding: 3rem 1rem;
    }
    
    .info-section h2 {
        font-size: 2rem;
    }
    
    .generated-article {
        padding: 2rem 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 1rem;
    }
    
    .search-label {
        font-size: 1.25rem;
    }
    
    .content-area {
        padding: 1.5rem 1rem;
    }
    
    .empty-copy h2 {
        font-size: 1.75rem;
    }
    
    .empty-copy p {
        font-size: 1rem;
    }
    
    .empty-card,
    .info-card {
        padding: 1.5rem 1rem;
    }
}

/* Store badges row */
.footer-store-row {
    width: 100%;
    display: flex;
    justify-content: left !important;
    align-items: center;
    gap: 1.4rem;
    margin-top: 2rem;

    /* КРИТИЧЕСКОЕ: переводим в блочный режим */
    flex: 0 0 100%;
}

.store-badge {
    width: 20px;
    opacity: 0.55;
    filter: grayscale(100%);
    pointer-events: none; /* не кликабельные */
}

.store-badge img {
    width: 100%;
    height: auto;
    display: block;
}
