:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #10b981;
    --background-color: #ffffff;
    --background-secondary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-background: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --secondary-color: #34d399;
    --background-color: #0f172a;
    --background-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --card-background: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: calc(100% - 320px);
    transition: width 0.3s ease;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

/* Theme Toggle */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 5px;
    transition: var(--transition);
}

.theme-toggle i {
    position: absolute;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-toggle .fa-moon {
    left: 8px;
    color: #f59e0b;
}

.theme-toggle .fa-sun {
    right: 8px;
    color: #f59e0b;
}

.theme-switch {
    position: absolute;
    left: 4px;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-switch {
    transform: translateX(30px);
}

/* Input Section */
.input-section {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-with-icon {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Platform Badges */
.platform-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge.youtube {
    background: #ff0000;
    color: white;
}

.badge.instagram {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    color: white;
}

.badge.tiktok {
    background: #000000;
    color: white;
}
.badge.pinterest{
    background: #c8232c;
    color: white;
}

.platform-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.platform-hint i {
    color: var(--primary-color);
    margin-top: 2px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    display: none;
}

.video-preview {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.thumbnail-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--background-secondary);
    aspect-ratio: 16/9;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.thumbnail-overlay i {
    font-size: 3rem;
    color: white;
}

.thumbnail-container:hover .thumbnail-overlay {
    opacity: 1;
}

.video-info h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Formats Section */
.formats-section h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.format-tab {
    padding: 12px 24px;
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.format-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.format-tab:hover:not(.active) {
    border-color: var(--primary-color);
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.format-card {
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.format-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.format-card.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.format-card.selected .format-icon,
.format-card.selected .format-quality,
.format-card.selected .format-size,
.format-card.selected .format-resolution {
    color: white;
}

.format-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.format-quality {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.format-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.format-resolution {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.no-formats {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-formats i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.download-action {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-download {
    padding: 18px 48px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.btn-download:hover:not(:disabled) {
    background: #0da271;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.download-info {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Error Message */
.error-message {
    background: var(--error-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: none;
    align-items: center;
    gap: 12px;
}

.error-message i {
    font-size: 1.25rem;
}

/* Instructions */
.instructions {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.instructions h3 {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border-color);
}

.legal-warning {
    background: var(--warning-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.legal-warning i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--background-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 10001;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background: var(--error-color);
}

/* Стили для рекламного блока */
/* ... все предыдущие стили остаются без изменений до раздела рекламы ... */

/* Стили для рекламного блока (упрощенные) */
.ad-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--bg-color, var(--background-color));
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}

.ad-sidebar.collapsed {
    transform: translateX(100%);
}

.ad-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary, var(--background-secondary));
    position: sticky;
    top: 0;
    z-index: 1;
}

.ad-sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.ad-sidebar-footer {
    padding: 15px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary, var(--background-secondary));
    position: sticky;
    bottom: 0;
}

/* Удаляем ненужные стили для статических предложений */
.ad-sidebar-section,
.ad-sidebar-item,
.ad-badge,
.ad-sidebar-item-header,
.ad-sidebar-item-title,
.ad-sidebar-item-description,
.ad-sidebar-item-link {
    display: none;
}

/* Кнопка скрытия рекламы */
/* Кнопка скрытия рекламы - ВСЕГДА ВИДИМА */
.ad-toggle-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001; /* Выше, чем рекламный блок */
    background: var(--primary-color);
    color: white;
    border: none;
    width: 30px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
    opacity: 0.8;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

/* Когда реклама видна */
.ad-sidebar:not(.collapsed) ~ .ad-toggle-btn {
    right: 320px;
    border-radius: 4px 0 0 4px;
}

/* Когда реклама скрыта */
.ad-sidebar.collapsed ~ .ad-toggle-btn {
    right: 0;
    border-radius: 0 4px 4px 0;
}

.ad-toggle-btn:hover {
    opacity: 1;
    background: var(--primary-hover);
    width: 35px;
}

/* На мобильных скрываем кнопку */
@media (max-width: 992px) {
    .ad-toggle-btn {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .ad-sidebar {
        display: none;
    }
    
    .container {
        width: 100%;
        margin-right: 0;
    }
    
    .ad-toggle-btn {
        display: none;
    }
}

/* ... остальные стили остаются без изменений ... */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 2rem 0 1.5rem;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .platform-badges {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .video-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .formats-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .input-section,
    .results-section,
    .instructions {
        padding: 1.5rem;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
    }
    
    .format-tabs {
        flex-direction: column;
    }
}
