/* ═══════════════════════════════════════════════════
   SVG → GIF & Telegram Emoji Converter
   Design System & Styles
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.6);
    --bg-card-hover: rgba(17, 24, 39, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.5);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #6366f1;
    --accent-blue-light: #818cf8;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;

    --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.05));
    --gradient-bg: radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.15), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.1), transparent 60%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout ── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Header ── */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--accent-blue-light);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

.header-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

.privacy-note {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-emerald);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── Glass Card ── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.card-title .icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(99, 102, 241, 0.04);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
    opacity: 1;
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.drop-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.drop-zone .browse-link {
    color: var(--accent-blue-light);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.file-input {
    display: none;
}

/* ── File Info ── */
.file-info {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.file-info.active {
    display: flex;
}

.file-info .file-icon {
    font-size: 1.5rem;
}

.file-info .file-details {
    flex: 1;
}

.file-info .file-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.file-info .file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-info .remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.file-info .remove-btn:hover {
    color: var(--accent-rose);
}

/* ── SVG Preview ── */
.svg-preview-area {
    display: none;
    margin-top: 1.5rem;
}

.svg-preview-area.active {
    display: block;
}

.svg-preview-container {
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
}

.svg-preview-container svg {
    max-width: 100%;
    max-height: 350px;
}

/* ── Settings Grid ── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.content-grid.content-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

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

@media (max-width: 768px) {

    .content-grid,
    .content-grid.content-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ── Form Controls ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    transition: var(--transition);
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Toggle / Checkbox ── */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-group:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(71, 85, 105, 0.5);
    border-radius: 999px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Convert Button ── */
.convert-section {
    margin-top: 2rem;
    text-align: center;
}

.convert-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 2.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.convert-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: var(--transition);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.convert-btn:hover::before {
    opacity: 1;
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.convert-btn .btn-icon {
    font-size: 1.2rem;
}

/* ── Progress ── */
.progress-section {
    display: none;
    margin-top: 2rem;
}

.progress-section.active {
    display: block;
}

.progress-bar-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 999px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ── Results ── */
.results-section {
    display: none;
    margin-top: 2rem;
}

.results-section.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.result-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.result-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-preview {
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 16px 16px;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-preview img,
.result-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.result-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.result-label.gif {
    color: var(--accent-cyan);
}

.result-label.webm {
    color: var(--accent-purple);
}

.result-label.sticker {
    color: var(--accent-emerald);
}

.result-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.telegram-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.telegram-badge.pass {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.telegram-badge.fail {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-xl);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.download-btn.gif-btn {
    background: linear-gradient(135deg, var(--accent-cyan), #0891b2);
}

.download-btn.webm-btn {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
}

.download-btn.sticker-btn {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
}

/* ── Sticker Info Box ── */
.sticker-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.sticker-info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.sticker-info-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-emerald);
    font-variant-numeric: tabular-nums;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ── Error ── */
.error-message {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-rose);
    font-size: 0.9rem;
    text-align: center;
}

.error-message.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* ── Footer ── */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--accent-blue-light);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-tech {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ── Animated Background Orbs ── */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: float 20s infinite;
}

.bg-orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    top: -100px;
    left: -100px;
}

.bg-orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.bg-orb:nth-child(3) {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ── Benefits Grid ── */
.seo-section {
    margin-top: 2rem;
}

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

.benefit-item {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.benefit-item:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.benefit-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.6rem;
}

.benefit-item h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
}

.benefit-item strong {
    color: var(--accent-blue-light);
}

/* ── How It Works ── */
.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue-light);
    font-weight: 800;
    font-size: 1.5rem;
}

.step h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.55;
}

/* ── FAQ Accordion ── */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.faq-item[open] {
    border-color: var(--border-active);
}

.faq-item summary {
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.1rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.faq-item code {
    background: rgba(99, 102, 241, 0.15);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--accent-blue-light);
}

.faq-item a {
    color: var(--accent-blue-light);
    text-decoration: none;
}

.faq-item a:hover {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 1.25rem 1rem 3rem;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }
}