@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e5e7eb;
    background-color: #0b1220;
    background: 
        radial-gradient(ellipse 800px 600px at 10% 20%, rgba(139,92,246,.22), transparent),
        radial-gradient(ellipse 1000px 800px at 90% 0%, rgba(6,182,212,.18), transparent),
        radial-gradient(ellipse 600px 500px at 50% 100%, rgba(99,102,241,.15), transparent),
        radial-gradient(ellipse 900px 700px at 0% 100%, rgba(236,72,153,.10), transparent),
        linear-gradient(180deg, #141824 0%, #12192a 50%, #171e2e 100%);
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

/* Static mesh gradient overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle 600px at 30% 20%, rgba(139,92,246,.08), transparent),
        radial-gradient(circle 800px at 70% 80%, rgba(6,182,212,.06), transparent);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.gradient-bg {
    background: 
        radial-gradient(ellipse 800px 600px at 10% 20%, rgba(139,92,246,.22), transparent),
        radial-gradient(ellipse 1000px 800px at 90% 0%, rgba(6,182,212,.18), transparent),
        radial-gradient(ellipse 600px 500px at 50% 100%, rgba(99,102,241,.15), transparent),
        linear-gradient(135deg, rgba(15,23,42,.92) 0%, rgba(11,18,32,.95) 50%, rgba(15,23,42,.93) 100%);
}

.upload-area-hover:hover {
    border-color: rgba(139,92,246,.5);
    background-color: rgba(15,23,42,.7);
}

.try-badge {
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
    border-radius: 20px;
    padding: 8px 20px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transform: rotate(-5deg);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.comparison-arrow {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* ===== COMPARISON SLIDER HANDLE ===== */
.slider-handle {
    pointer-events: none;
}

.slider-handle > div {
    pointer-events: auto;
    cursor: ew-resize;
}

/* ========================================
   АДАПТИВНОСТЬ ДЛЯ РАЗНЫХ УСТРОЙСТВ
   ======================================== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .max-w-container {
        max-width: 1400px;
    }
}

/* Medium Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .max-w-container {
        max-width: 1200px;
    }
    
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 3.5rem !important;
    }
    
    h2.text-4xl,
    h2.lg\:text-6xl {
        font-size: 2.5rem !important;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .max-w-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 3rem !important;
    }
    
    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 2rem !important;
    }
    
    .grid.md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    #uploadArea {
        padding: 3rem 2rem;
    }
    
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile Landscape & Small Tablets (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .max-w-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 2.25rem !important;
        line-height: 1.2 !important;
    }
    
    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 1.75rem !important;
    }
    
    #uploadArea {
        padding: 2.5rem 1.5rem;
    }
    
    #uploadArea button {
        font-size: 0.938rem;
        padding: 0.875rem 1.75rem;
    }
    
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    .try-badge {
        font-size: 0.75rem;
        padding: 6px 14px;
    }
}

/* Large Mobile (426px - 480px) */
@media (min-width: 426px) and (max-width: 480px) {
    .max-w-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 1.625rem !important;
    }
    
    button,
    .btn {
        font-size: 0.875rem;
        padding: 0.813rem 1.5rem;
    }
    
    #uploadArea {
        padding: 2.25rem 1.25rem;
    }
    
    #uploadArea button {
        font-size: 0.875rem;
        padding: 0.75rem 1.5rem;
        max-width: 100%;
    }
    
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    .py-20 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    
    .py-24 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
}

/* Standard Mobile (376px - 425px) */
@media (min-width: 376px) and (max-width: 425px) {
    .max-w-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 1.875rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    section p.text-xl {
        font-size: 0.938rem !important;
    }
    
    button,
    .btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.5rem;
    }
    
    #uploadArea {
        padding: 2rem 1.25rem;
    }
    
    #uploadArea svg {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    #uploadArea button {
        font-size: 0.813rem;
        padding: 0.688rem 1.25rem;
        max-width: 100%;
    }
    
    .try-badge {
        font-size: 0.625rem !important;
        padding: 4px 10px !important;
    }
    
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    .gap-12 {
        gap: 2rem !important;
    }
    
    .gap-8 {
        gap: 1.5rem !important;
    }
}

/* Small Mobile (321px - 375px) */
@media (min-width: 321px) and (max-width: 375px) {
    body {
        font-size: 14px;
    }

    .max-w-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    h1,
    h1.text-5xl {
        font-size: 1.875rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        font-weight: 800 !important;
    }

    h1.lg\:text-7xl {
        font-size: 1.875rem !important;
        font-weight: 800 !important;
    }

    p.text-lg,
    p.lg\:text-xl {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }

    button,
    .btn {
        font-size: 0.875rem !important;
        padding: 0.75rem 1.5rem !important;
    }

    #uploadArea {
        padding: 2rem 1rem !important;
    }

    #uploadArea svg {
        width: 3rem;
        height: 3rem;
        margin-bottom: 1rem;
    }

    #uploadArea p.text-lg {
        font-size: 0.875rem;
    }

    #uploadArea p.text-sm {
        font-size: 0.75rem;
        margin-bottom: 1rem !important;
    }

    #uploadArea button {
        font-size: 0.75rem !important;
        padding: 0.625rem 1rem !important;
        font-weight: 600 !important;
        width: 100% !important;
        max-width: 280px !important;
    }

    .try-badge {
        font-size: 0.625rem;
        padding: 5px 10px;
        left: 0rem !important;
    }

    .try-badge svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    section p.text-xl {
        font-size: 0.875rem !important;
    }

    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .py-24 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    .lg\:py-28 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .gap-12 {
        gap: 2rem !important;
    }

    .gap-8 {
        gap: 1.5rem !important;
    }

    .gap-6 {
        gap: 1rem !important;
    }

    .rounded-3xl {
        border-radius: 1.25rem !important;
    }

    .rounded-2xl {
        border-radius: 1rem !important;
    }

    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* Very Small Mobile (320px and below) */
@media (max-width: 320px) {
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 1.75rem !important;
    }

    h2.text-4xl,
    h2.lg\:text-6xl,
    h2.lg\:text-5xl {
        font-size: 1.375rem !important;
    }

    section p.text-xl {
        font-size: 0.813rem !important;
    }

    .max-w-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    button,
    .btn {
        padding: 0.625rem 1rem !important;
        font-size: 0.75rem !important;
    }

    #uploadArea {
        padding: 1.5rem 0.75rem !important;
    }

    #uploadArea svg {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    #uploadArea button {
        font-size: 0.688rem !important;
        padding: 0.5rem 0.875rem !important;
        width: 100% !important;
        max-width: 240px !important;
    }

    #uploadArea p.text-lg {
        font-size: 0.813rem !important;
    }

    #uploadArea p.text-sm {
        font-size: 0.688rem !important;
    }

    .try-badge {
        font-size: 0.563rem;
        padding: 4px 8px;
        left: 0.75rem !important;
    }

    .try-badge svg {
        width: 1rem;
        height: 1rem;
    }

    .comparison-arrow {
        padding: 0.375rem !important;
    }

    .comparison-arrow svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    .slider-handle > div {
        width: 2rem !important;
        height: 2rem !important;
    }

    .slider-handle > div svg {
        width: 1rem;
        height: 1rem;
    }

    .py-20 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .gap-12 {
        gap: 1.5rem !important;
    }

    .gap-8 {
        gap: 1.25rem !important;
    }

    .gap-6 {
        gap: 0.875rem !important;
    }

    .rounded-3xl {
        border-radius: 1rem !important;
    }

    .rounded-2xl {
        border-radius: 0.875rem !important;
    }

    .rounded-xl {
        border-radius: 0.75rem !important;
    }
}

/* ===== ОБЩИЕ АДАПТИВНЫЕ УЛУЧШЕНИЯ ДЛЯ ВСЕХ МОБИЛЬНЫХ УСТРОЙСТВ ===== */
@media (max-width: 767px) {
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .comparison-arrow {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .aspect-\[4\/5\] {
        aspect-ratio: 4/5;
    }

    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    section.gradient-bg .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .absolute.w-72,
    .absolute.w-96 {
        opacity: 0.3;
    }
}

/* ===== УЛУЧШЕНИЯ ДЛЯ ПЛАНШЕТОВ В LANDSCAPE РЕЖИМЕ ===== */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    h1.text-5xl,
    h1.lg\:text-7xl {
        font-size: 3.25rem !important;
    }

    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .py-24 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    section.gradient-bg .grid.lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    #uploadArea {
        padding: 2rem 1.5rem;
    }
}

/* ========================================
   HERO DYNAMIC STATES - Трансформация внутри
   ======================================== */

/* АДАПТИВНЫЙ H1 - Всегда видимый */
.hero-title-container {
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: #f1f5f9;
    text-shadow: 0 2px 8px rgba(139,92,246,.3);
    line-height: 1.2;
    margin-bottom: 1rem;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-subtitle {
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    color: #cbd5e1;
    max-width: 42rem;
    margin: 0 auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* H1 в режиме loaded - компактный, смещен влево */
#heroContainer[data-state="loaded"] .hero-title-container {
    text-align: left;
    margin-bottom: 1.5rem;
}

#heroContainer[data-state="loaded"] .hero-h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
}

#heroContainer[data-state="loaded"] .hero-subtitle {
    font-size: clamp(0.813rem, 1.2vw, 0.938rem);
    color: #10b981;
    max-width: 100%;
}

/* Hero States - Плавная трансформация */
.hero-state {
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-state.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

#heroUploadState {
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

#heroWorkspaceState {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

/* Когда hero в режиме loaded */
#heroContainer[data-state="loaded"] #heroUploadState {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
}

#heroContainer[data-state="loaded"] #heroWorkspaceState {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
}

/* Workspace Grid Layout */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start;
}

/* ===== LEFT PANEL: Image Preview - REDESIGNED ===== */
.image-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Новый адаптивный контейнер - чистый дизайн без hover эффектов */
.image-preview-container {
    position: relative;
    background: linear-gradient(135deg, rgba(15,23,42,.95) 0%, rgba(11,18,32,.98) 100%);
    border-radius: 24px;
    padding: 1rem;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Статичная рамка без анимации */
.image-preview-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.3) 0%, 
        rgba(99, 102, 241, 0.2) 50%,
        rgba(139, 92, 246, 0.3) 100%
    );
    border-radius: 24px;
    z-index: -1;
    opacity: 0.5;
}

/* Внутренний контейнер - ПОЛНОСТЬЮ адаптивный */
.image-preview {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    overflow: hidden;
    line-height: 0;
}

/* Изображения - адаптируются под свой размер */
.image-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.3s ease;
}

/* Loading state */
.image-preview.loading {
    background: linear-gradient(
        90deg, 
        rgba(15,23,42,0.3) 0%, 
        rgba(139,92,246,0.1) 50%, 
        rgba(15,23,42,0.3) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Image Controls */
.image-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid;
}

.control-btn-secondary {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    border-color: rgba(139,92,246,0.3);
    color: #a78bfa;
}

.control-btn-secondary:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
    border-color: rgba(139,92,246,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.control-btn-danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(220,38,38,0.1));
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}

.control-btn-danger:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(220,38,38,0.2));
    border-color: rgba(239,68,68,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

/* ===== RIGHT PANEL: Tools ===== */
.tools-panel {
    background: linear-gradient(135deg, rgba(15,23,42,.85) 0%, rgba(11,18,32,.95) 100%);
    border: 2px solid rgba(139,92,246,.35);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    max-height: none;
    overflow-y: visible;
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(139, 92, 246, 0.15);
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom Scrollbar */
.tools-panel::-webkit-scrollbar {
    width: 8px;
}

.tools-panel::-webkit-scrollbar-track {
    background: rgba(15,23,42,0.3);
    border-radius: 4px;
}

.tools-panel::-webkit-scrollbar-thumb {
    background: rgba(139,92,246,0.3);
    border-radius: 4px;
}

.tools-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(139,92,246,0.5);
}

/* Panel Header */
.panel-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(139,92,246,0.2);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0;
}

.panel-title svg {
    color: #8b5cf6;
}

/* Panel Sections */
.panel-section {
    margin-bottom: 2rem;
}

.panel-section:last-child {
    margin-bottom: 0;
}

.section-label {
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    align-items: stretch; /* Растягивать карточки по высоте */
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    min-height: 80px; /* Фиксированная минимальная высота */
    background: linear-gradient(135deg, rgba(30,41,59,0.6), rgba(15,23,42,0.8));
    border: 2px solid rgba(100,116,139,0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mode-card:hover {
    border-color: rgba(139,92,246,0.4);
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.05));
    transform: translateY(-2px);
}

.mode-card.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(99,102,241,0.1));
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.mode-card.pro-locked {
    opacity: 0.7;
}

.mode-card.pro-locked:hover {
    opacity: 1;
}

.pro-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.1);
}

.mode-icon-auto {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.mode-icon-photo {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.mode-icon-anime {
    background: linear-gradient(135deg, #ec4899, #a855f7);
}

.mode-icon-hq {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.mode-icon svg {
    color: white;
}

.mode-info {
    flex: 1;
}

.mode-name {
    font-weight: 700;
    font-size: 14px;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 12px;
    color: #94a3b8;
}

/* Scale Selector */
.scale-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scale-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(30,41,59,0.6), rgba(15,23,42,0.8));
    border: 2px solid rgba(100,116,139,0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-option:hover {
    border-color: rgba(139,92,246,0.4);
    transform: translateX(4px);
}

.scale-option.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(99,102,241,0.1));
}

.scale-option.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.scale-option.locked:hover {
    transform: none;
}

.scale-check,
.scale-lock {
    width: 20px;
    height: 20px;
    color: #8b5cf6;
    flex-shrink: 0;
}

.scale-lock {
    color: #94a3b8;
}

.scale-value {
    font-size: 18px;
    font-weight: 800;
    color: #f1f5f9;
}

.scale-label {
    font-size: 13px;
    color: #94a3b8;
    margin-left: auto;
}

/* Options List */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* Locked checkbox styling */
.option-item[data-requires-auth="true"] {
    position: relative;
}

.option-item[data-requires-auth="true"].option-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-item[data-requires-auth="true"].option-locked .option-toggle {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-item[data-requires-auth="true"] .lock-icon {
    color: #94a3b8;
}

.option-checkbox {
    display: none;
}

.option-toggle {
    width: 48px;
    height: 26px;
    background: rgba(100,116,139,0.3);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.option-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.option-checkbox:checked + .option-toggle {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.option-checkbox:checked + .option-toggle::after {
    transform: translateX(22px);
}

.option-text {
    flex: 1;
}

.option-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.option-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* Process Button - Полностью адаптивная кнопка БЕЗ Tailwind */
.process-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.1);
}

.process-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(139, 92, 246, 0.5),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.process-btn:active {
    transform: translateY(0);
}

/* Desktop 1024px-1439px */
@media (min-width: 1024px) and (max-width: 1439px) {
    .process-btn {
        padding: 1.125rem 1.75rem;
        font-size: 15px;
        gap: 0.75rem;
    }
    
    .process-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* Tablet 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .process-btn {
        padding: 1rem 1.5rem;
        font-size: 15px;
        gap: 0.625rem;
    }
    
    .process-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile L 426px-767px */
@media (min-width: 426px) and (max-width: 767px) {
    .process-btn {
        padding: 0.938rem 1.375rem;
        font-size: 14px;
        gap: 0.625rem;
    }
    
    .process-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile M 376px-425px */
@media (min-width: 376px) and (max-width: 425px) {
    .process-btn {
        padding: 0.875rem 1.25rem;
        font-size: 14px;
        gap: 0.5rem;
    }
    
    .process-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile S КРИТИЧНЫЙ: 321px-375px */
@media (min-width: 321px) and (max-width: 375px) {
    .process-btn {
        padding: 0.875rem 1.25rem;
        font-size: 14px;
        gap: 0.5rem;
    }
    
    .process-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile XS ≤320px */
@media (max-width: 320px) {
    .process-btn {
        padding: 0.75rem 1rem;
        font-size: 12px;
        gap: 0.5rem;
    }
    
    .process-btn svg {
        width: 16px;
        height: 16px;
    }
}

.process-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 13px;
    color: #94a3b8;
}

.process-hint.hidden {
    display: none;
}

/* Адаптивность для process-hint (если его показывать динамически) */
@media (min-width: 426px) and (max-width: 767px) {
    .process-hint {
        font-size: 12px;
        gap: 0.375rem;
    }
    
    .process-hint svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 321px) and (max-width: 425px) {
    .process-hint {
        font-size: 11px;
        gap: 0.375rem;
    }
    
    .process-hint svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 320px) {
    .process-hint {
        font-size: 10px;
        gap: 0.25rem;
    }
    
    .process-hint svg {
        width: 12px;
        height: 12px;
    }
}

/* Usage Info */
.usage-info {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.usage-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.usage-label {
    font-size: 13px;
    color: #cbd5e1;
}

.usage-value {
    font-weight: 700;
    font-size: 15px;
    color: #8b5cf6;
}

.usage-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 14px;
    font-weight: 600;
    color: #a78bfa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.usage-link:hover {
    color: #c4b5fd;
    gap: 0.5rem;
}

/* Все секции ВСЕГДА видны - никакого скрытия для SEO */
.original-sections {
    display: block;
}

/* ========================================
   EXPORT FORMAT SELECTOR
   ======================================== */

/* Export Format Section */
#exportFormatSection {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-format-selector {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Format Buttons - Segmented Control */
.format-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 6px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(100,116,139,0.2);
    border-radius: 12px;
}

.format-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.format-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.format-btn:hover {
    color: #cbd5e1;
}

.format-btn:hover::before {
    opacity: 1;
}

.format-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 
        0 4px 12px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

.format-btn.active:hover {
    box-shadow: 
        0 6px 16px rgba(139, 92, 246, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.3);
}

.format-name {
    position: relative;
    z-index: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Quality Slider Container */
.quality-slider {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.quality-slider.hidden {
    display: none;
}

/* Quality Header */
.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quality-label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-value {
    font-size: 15px;
    font-weight: 700;
    color: #8b5cf6;
    min-width: 45px;
    text-align: right;
}

/* Custom Range Slider */
.quality-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, 
        rgba(239,68,68,0.3) 0%, 
        rgba(245,158,11,0.3) 50%, 
        rgba(34,197,94,0.3) 100%
    );
    border-radius: 3px;
    outline: none;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.quality-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 2px 8px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
}

.quality-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 4px 12px rgba(139, 92, 246, 0.5),
        0 0 0 3px rgba(139, 92, 246, 0.3);
}

.quality-range::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

/* Firefox */
.quality-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 2px 8px rgba(139, 92, 246, 0.4),
        0 0 0 2px rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
}

.quality-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 4px 12px rgba(139, 92, 246, 0.5),
        0 0 0 3px rgba(139, 92, 246, 0.3);
}

.quality-range::-moz-range-track {
    background: linear-gradient(90deg, 
        rgba(239,68,68,0.3) 0%, 
        rgba(245,158,11,0.3) 50%, 
        rgba(34,197,94,0.3) 100%
    );
    border-radius: 3px;
}

/* Quality Marks */
.quality-marks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.quality-marks span {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-panel {
        position: static;
        margin-top: 2rem;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .image-controls {
        flex-direction: column;
    }
    
    .control-btn {
        min-width: 100%;
    }
    
    /* Оптимизация preview для мобильных */
    .image-preview-container {
        min-height: 300px !important;
        padding: 1rem !important;
    }
}

/* Экстра оптимизация для очень маленьких экранов */
@media (max-width: 480px) {
    .image-preview-container {
        min-height: 250px !important;
        padding: 0.75rem !important;
    }
}

/* ========================================
   UPSCALE RESULT STYLES (NEW)
   ======================================== */

/* Upscale Result Container */
.upscale-result-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* Comparison Slider Result - УЛУЧШЕННЫЙ Before/After */
.comparison-slider-result {
  position: relative;
  width: 100%;
  min-height: 400px;
  max-height: 75vh;
  overflow: hidden;
  border-radius: 16px;
  cursor: ew-resize;
  user-select: none;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 12px 32px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s ease;
}

.comparison-slider-result:hover {
  box-shadow: 
    0 16px 48px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Before Image - базовый слой */
.result-before-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* After Image Container - обрезается через clip-path */
.result-after-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: clip-path;
}

.result-after-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 75vh;
}

/* Slider Divider - мгновенное перемещение */
.slider-divider-result {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.9) 10%,
    white 50%,
    rgba(255, 255, 255, 0.9) 90%,
    transparent 100%
  );
  box-shadow: 
    0 0 20px rgba(139, 92, 246, 0.6),
    0 0 40px rgba(139, 92, 246, 0.3);
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  transition: box-shadow 0.3s ease;
  will-change: left;
}

.comparison-slider-result:hover .slider-divider-result {
  box-shadow: 
    0 0 30px rgba(139, 92, 246, 0.8),
    0 0 60px rgba(139, 92, 246, 0.4);
}

/* Slider Handle - мгновенное перемещение без лага */
.slider-handle-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 16px rgba(0,0,0,0.4),
    0 0 0 4px rgba(139, 92, 246, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: ew-resize;
  /* Transition ТОЛЬКО для hover эффектов, НЕ для позиционирования */
  transition: box-shadow 0.2s ease;
  pointer-events: auto;
  z-index: 11;
  will-change: left;
}

.slider-handle-result::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slider-handle-result:hover {
  box-shadow: 
    0 6px 24px rgba(139, 92, 246, 0.4),
    0 0 0 4px rgba(139, 92, 246, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.slider-handle-result:hover::before {
  opacity: 1;
}

.slider-handle-result:active {
  box-shadow: 
    0 4px 16px rgba(139, 92, 246, 0.5),
    0 0 0 4px rgba(139, 92, 246, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

.slider-handle-result svg {
    color: #8b5cf6;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Download Button в image-controls */
#downloadUpscaledBtn {
  display: none;
  flex: 1;
  min-width: 200px;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid;
  background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(5,150,105,0.15));
  border-color: rgba(16,185,129,0.4);
  color: #10b981;
  position: relative;
}

#downloadUpscaledBtn:hover {
  background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(5,150,105,0.25));
  border-color: rgba(16,185,129,0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

#downloadUpscaledBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#downloadUpscaledBtn.visible {
  display: flex;
}

/* Format Dropdown */
.format-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(15,23,42,.95) 0%, rgba(11,18,32,.98) 100%);
  border: 2px solid rgba(139,92,246,.35);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.1);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.format-dropdown.active {
  display: flex;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.format-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(100,116,139,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
}

.format-dropdown-item:hover {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.4);
}

.format-dropdown-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.format-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(139,92,246,0.2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
}

/* Quality Slider для JPG */
.quality-slider-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.quality-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

.quality-slider-header .quality-value {
  color: #8b5cf6;
  font-weight: 700;
}

.quality-range-inline {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    rgba(239,68,68,0.3) 0%, 
    rgba(245,158,11,0.3) 50%, 
    rgba(34,197,94,0.3) 100%
  );
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.quality-range-inline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

.quality-range-inline::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .slider-handle-result {
    width: 40px;
    height: 40px;
  }
  
  .slider-handle-result svg {
    width: 20px;
    height: 20px;
  }
  
  .label-before-result,
  .label-after-result {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  #downloadUpscaledBtn {
    min-width: 100%;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .slider-handle-result {
    width: 36px;
    height: 36px;
    border: 3px solid #8b5cf6;
  }
  
  .slider-handle-result svg {
    width: 18px;
    height: 18px;
  }
  
  .label-before-result,
  .label-after-result {
    font-size: 11px;
    padding: 5px 10px;
    top: 12px;
  }
}

/* ========================================
   EXPORT ZONE - СТАЦИОНАРНАЯ ЗОНА ЭКСПОРТА
   ======================================== */

/* Зона экспорта - появляется после апскейла */
.export-zone {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
  border: 2px solid rgba(139,92,246,0.25);
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.export-zone.hidden {
  display: none;
}

/* Анимация появления */
.export-zone:not(.hidden) {
  animation: slideInUpSmooth 0.4s ease;
}

@keyframes slideInUpSmooth {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Segmented buttons для формата */
.export-format-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  background: rgba(15,23,42,0.6);
  border-radius: 12px;
}

.format-segment {
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.format-segment::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.format-segment:hover {
  color: #cbd5e1;
}

.format-segment:hover::before {
  opacity: 1;
}

.format-segment.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 
    0 4px 12px rgba(139, 92, 246, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.2);
}

.format-segment.active:hover {
  box-shadow: 
    0 6px 16px rgba(139, 92, 246, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.3);
}

.format-name {
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Ползунок качества */
.quality-control {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 12px;
}

.quality-control.hidden {
  display: none;
}

.quality-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quality-label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quality-value {
  font-size: 15px;
  font-weight: 700;
  color: #8b5cf6;
  min-width: 45px;
  text-align: right;
}

.quality-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, 
    rgba(239,68,68,0.3) 0%, 
    rgba(245,158,11,0.3) 50%, 
    rgba(34,197,94,0.3) 100%
  );
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.quality-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 
    0 2px 8px rgba(139, 92, 246, 0.4),
    0 0 0 2px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.quality-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 
    0 4px 12px rgba(139, 92, 246, 0.5),
    0 0 0 3px rgba(139, 92, 246, 0.3);
}

.quality-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 
    0 2px 8px rgba(139, 92, 246, 0.4),
    0 0 0 2px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.quality-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 
    0 4px 12px rgba(139, 92, 246, 0.5),
    0 0 0 3px rgba(139, 92, 246, 0.3);
}

.quality-range::-moz-range-track {
  background: linear-gradient(90deg, 
    rgba(239,68,68,0.3) 0%, 
    rgba(245,158,11,0.3) 50%, 
    rgba(34,197,94,0.3) 100%
  );
  border-radius: 3px;
}

/* Финальная кнопка скачивания */
.final-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.final-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.final-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.final-download-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive для зоны экспорта */
@media (max-width: 768px) {
  .export-zone {
    padding: 1.25rem;
  }
  
  .export-format-selector {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .format-segment {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .final-download-btn {
    padding: 1rem 1.5rem;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .export-zone {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  .quality-control {
    padding: 0.875rem;
  }
  
  .final-download-btn {
    padding: 0.875rem 1.25rem;
    font-size: 14px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
    .try-badge {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    section {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}
