/* Основные стили для AIPoVibe Chat */

:root {
    /* Apple-inspired color palette */
    --primary-color: #007AFF;
    --primary-hover: #0051D5;
    --secondary-color: #8E8E93;
    --accent-color: #34C759;
    --error-color: #FF3B30;
    --warning-color: #FF9500;
    
    /* Text colors */
    --text-primary: #000000;
    --text-secondary: #6D6D70;
    --text-tertiary: #C7C7CC;
    
    /* Background colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-tertiary: #FFFFFF;
    --bg-grouped: #F2F2F7;
    
    /* Border and separator */
    --border-color: rgba(60, 60, 67, 0.12);
    --separator-color: rgba(60, 60, 67, 0.12);
    
    /* Shadows - Apple style */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.15);
    
    /* Border radius - Apple style */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* Spacing system */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    line-height: 1.47;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

main {
    flex: 1;
    padding-bottom: var(--spacing-3xl);
}

/* Утилитарные классы */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

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

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

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

.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-2 { padding: 0.5rem 0; }
.py-4 { padding: 1rem 0; }
.px-4 { padding: 0 1rem; }
.px-6 { padding: 0 1.5rem; }

/* Apple-style buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 17px;
    line-height: 1.23;
    letter-spacing: -0.022em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.btn-large {
    padding: 16px 32px;
    font-size: 19px;
    border-radius: var(--radius-lg);
}

.btn-yandex {
    background-color: #fc3f1d;
    color: white;
    gap: 0.5rem;
}

.btn-yandex:hover {
    background-color: #e6381a;
}

/* Карточки */
/* Apple-style Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

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

.card-image {
    width: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    transition: transform 0.4s ease;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.17;
    letter-spacing: -0.022em;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.card-description {
    font-size: 17px;
    line-height: 1.47;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    flex: 1;
}

.card .btn {
    width: 100%;
    justify-content: center;
}

/* Apple-style Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.022em;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.05);
}

/* Apple-style Hero Section */
.hero {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--spacing-3xl) var(--spacing-lg) calc(var(--spacing-3xl) + var(--spacing-xl));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(48px, 6vw, 80px);
    font-weight: 600;
    line-height: 1.07;
    letter-spacing: -0.022em;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(19px, 2.5vw, 24px);
    line-height: 1.42;
    letter-spacing: -0.022em;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto var(--spacing-2xl);
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }
}

/* Apple-style Services Section */
.services-section {
    background: var(--bg-secondary);
    padding: var(--spacing-3xl) var(--spacing-lg);
}

.services-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.services-header h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.022em;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.services-header p {
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.48;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

/* Для больших экранов - ограничиваем до 3 колонок для лучшего вида */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

/* Для средних экранов - 2 колонки */
@media (min-width: 768px) and (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

/* Рабочие области */
.workspace {
    min-height: calc(100vh - 80px);
    background: var(--bg-secondary);
    padding: var(--spacing-lg) 0;
}

.workspace-header {
    background: var(--bg-primary);
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.workspace-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.workspace-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

.workspace-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    padding: 0 var(--spacing-lg);
    min-height: calc(100vh - 200px);
}

.workspace-panel,
.input-panel,
.result-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

.panel-header {
    background: var(--bg-secondary);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.panel-content {
    padding: var(--spacing-xl);
}

.panel-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.result-area {
    min-height: 300px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.6;
}

.placeholder-text {
    font-size: 1rem;
    line-height: 1.5;
}

/* Поля ввода для workspace */
.workspace textarea {
    width: 100%;
    min-height: 200px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.workspace textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.workspace select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.workspace select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Пользовательское меню в workspace */
.user-info {
    position: relative;
    cursor: pointer;
}

.user-info:hover .user-dropdown {
    display: block;
}

/* Формы и поля ввода */
.textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: transparent;
}

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload:hover,
.file-upload.dragover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-upload-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Пользовательское меню */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.user-info {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    margin-top: 0.5rem;
    z-index: 9999;
    display: none;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: var(--secondary-color);
}

/* Подсветка изменений текста */
.text-diff-added {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-color);
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
}

.text-diff-removed {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    text-decoration: line-through;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
}

/* Apple-style responsive design */
@media (max-width: 1024px) {
    .header-content {
        padding: var(--spacing-md);
    }
    
    .hero {
        padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-3xl);
    }
    
    .services-section {
        padding: var(--spacing-2xl) var(--spacing-md);
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .logo {
        font-size: 20px;
    }
    
    .hero {
        padding: var(--spacing-xl) var(--spacing-md) var(--spacing-2xl);
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .services-section {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .services-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
.card-content {
    padding: var(--spacing-lg);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.ai-badge::before {
    content: "⚡";
    font-size: 0.8rem;
}

/* Dashboard footer */
.dashboard-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-3xl);
    text-align: center;
}

.dashboard-footer .logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.dashboard-footer .logo-section img {
    width: 24px;
    height: 24px;
}

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

/* Кликабельные карточки */
.card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.card .btn {
    pointer-events: none;
}

/* Footer иконки на десктопе */
footer .container .text-center .flex img {
    width: 28px !important;
    height: 28px !important;
}

/* Дополнительные стили для workspace */
.text-sm {
    font-size: 0.875rem;
}

.text-secondary {
    color: var(--text-secondary);
}

.upload-icon {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.upload-text {
    color: var(--text-secondary);
    text-align: center;
}

.upload-text strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.upload-text p {
    margin: var(--spacing-xs) 0;
}

.upload-text small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Новые элементы для дополнительных сервисов */
.language-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.language-group {
    flex: 1;
}

.language-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.language-select, .setting-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.language-select:focus, .setting-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.swap-languages {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    margin-top: 1.5rem;
}

.swap-languages:hover {
    background: var(--primary-hover);
    transform: rotate(180deg);
}

.story-settings, .prompt-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.setting-group {
    margin-bottom: var(--spacing-md);
}

.setting-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.upload-tips, .story-tips, .generation-tips {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05), rgba(52, 199, 89, 0.05));
    padding: var(--spacing-lg);
    border-radius: var(--radius);
    margin-top: var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
}

.upload-tips h3, .story-tips h3, .generation-tips h3 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.upload-tips ul, .story-tips ul, .generation-tips ul {
    margin: 0;
    padding-left: var(--spacing-lg);
}

.upload-tips li, .story-tips li, .generation-tips li {
    margin-bottom: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.translated-text, .detective-story {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Форматированные детективные истории */
.detective-story.formatted {
    white-space: normal;
}

.detective-story.formatted h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: bold;
    margin: 0 0 1em 0;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--border-color);
}

.detective-story.formatted p {
    margin: 1em 0;
    text-align: justify;
}

.detective-story.formatted strong {
    color: var(--primary-color);
    font-weight: 600;
}

.detective-story.formatted p:first-child {
    margin-top: 0;
}

.detective-story.formatted p:last-child {
    margin-bottom: 0;
}

.image-result-area {
    min-height: 400px;
}

.generated-image {
    text-align: center;
}

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-md);
}

.image-info {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius);
    text-align: left;
}

.image-info p {
    margin: var(--spacing-xs) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .language-selector {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .swap-languages {
        margin-top: 0;
        transform: rotate(90deg);
    }
    
    .story-settings, .prompt-settings {
        grid-template-columns: 1fr;
    }
}
    
    .workspace-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .workspace-header {
        padding: var(--spacing-lg) 0;
    }
    
    .workspace-header h1 {
        font-size: 2rem;
    }
    
    .workspace-header p {
        font-size: 1rem;
    }
    
    .panel-content {
        padding: var(--spacing-lg);
    }
    
    .panel-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .panel-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: var(--spacing-lg) var(--spacing-md) var(--spacing-xl);
    }
    
    /* Скрываем текст кнопки Яндекс на мобильной версии (страница входа) */
    .yandex-btn span {
        display: none;
    }
    
    .yandex-btn {
        padding: 1rem;
        justify-content: center;
        min-width: 60px;
    }
    
    /* Скрываем текст кнопки Яндекс в мобильном меню */
    .btn-yandex {
        font-size: 0;
        padding: 0.5rem 0.75rem;
        min-width: 44px;
    }
    
    .btn-yandex img {
        margin: 0;
        width: 18px !important;
        height: 18px !important;
    }
    
    .services-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .services-grid {
        gap: var(--spacing-md);
    }
    
    .card {
        margin: 0;
    }
    
    .card-content {
        padding: var(--spacing-lg);
    }
    
    .ai-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* Лоадер */
.loader {
    border: 3px solid var(--secondary-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background-color: var(--accent-color);
}

.notification.error {
    background-color: var(--error-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Apple-style преимущества с большим количеством воздуха */
.advantages-section {
    background: var(--bg-primary);
    padding: calc(var(--spacing-3xl) + var(--spacing-lg)) var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.advantages-header {
    text-align: center;
    margin-bottom: calc(var(--spacing-3xl) + var(--spacing-xl));
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.advantages-header h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.022em;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.advantages-header p {
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.48;
    color: var(--text-secondary);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: calc(var(--spacing-xl) + var(--spacing-lg));
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.advantage-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-xl) + var(--spacing-md));
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.advantage-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(0, 122, 255, 0.2);
}

.advantage-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto calc(var(--spacing-lg) + var(--spacing-md));
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.25);
    transition: all 0.3s ease;
}

.advantage-card:hover .advantage-icon {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 122, 255, 0.35);
}

.advantage-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.17;
    letter-spacing: -0.022em;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-md) + var(--spacing-sm));
}

.advantage-description {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.47;
    margin-bottom: 0;
}

/* Анимации появления */
.advantage-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.advantage-card:nth-child(1) { animation-delay: 0.1s; }
.advantage-card:nth-child(2) { animation-delay: 0.2s; }
.advantage-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для страницы входа */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1)"/><stop offset="100%" style="stop-color:rgba(255,255,255,0)"/></linearGradient></defs><polygon fill="url(%23grad)" points="0,1000 1000,0 1000,1000"/></svg>') no-repeat center center;
    background-size: cover;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-logo img {
    width: 48px;
    height: 48px;
    margin-right: 0.75rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.yandex-btn {
    width: 100%;
    background: linear-gradient(135deg, #fc3f1d, #e6381a);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(252, 63, 29, 0.3);
}

.yandex-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(252, 63, 29, 0.4);
    background: linear-gradient(135deg, #e6381a, #d63218);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-hover);
}

/* Apple-style блок статистики с воздухом */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-3xl) + var(--spacing-lg));
    margin-top: calc(var(--spacing-3xl) + var(--spacing-xl));
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.stats-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-header {
    text-align: center;
    margin-bottom: calc(var(--spacing-3xl) + var(--spacing-xl));
}

.stats-title {
    color: white;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.022em;
    margin-bottom: var(--spacing-lg);
}

.stats-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.48;
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-xl) + var(--spacing-lg));
    margin-bottom: calc(var(--spacing-xl) + var(--spacing-md));
}

/* Адаптивная сетка для статистики */
@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1000px) and (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 999px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: calc(var(--spacing-xl) + var(--spacing-md));
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.stat-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto calc(var(--spacing-lg) + var(--spacing-sm));
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.stat-number {
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 0;
    line-height: 1.47;
}

.stats-footer {
    text-align: center;
    margin-top: calc(var(--spacing-xl) + var(--spacing-lg));
    padding-top: calc(var(--spacing-xl) + var(--spacing-md));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.47;
}

/* Пульсирующая анимация для иконок */
.stat-icon {
    animation: pulse 2s ease-in-out infinite;
}

.stat-card:nth-child(1) .stat-icon { animation-delay: 0s; }
.stat-card:nth-child(2) .stat-icon { animation-delay: 0.3s; }
.stat-card:nth-child(3) .stat-icon { animation-delay: 0.6s; }

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
    
    .advantage-card {
        margin: 0 1rem;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-section {
        padding: 2rem;
        margin-top: 2rem;
    }
    
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stats-title {
        font-size: 1.75rem;
    }
}

/* Стили для анализа блюд */
.dish-analysis {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.dish-name {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.calories {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nutrition {
    background: var(--bg-white);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.dish-analysis .description {
    background: var(--bg-white);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.recommendations {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
    color: #92400e;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #fbbf24;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}
