:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-glow: rgba(79, 70, 229, 0.25);
    --secondary: #E0E7FF;
    --secondary-hover: #C7D2FE;
    --accent: #06B6D4;
    --accent-hover: #0891B2;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 20px;
}

[data-theme="dark"] {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #312E81;
    --secondary-hover: #3730A3;
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --nav-bg: rgba(30, 41, 59, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.mobile-only { display: none; }
.desktop-only { display: block; }

/* Navbar */
.navbar {
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}
.navbar.scrolled {
    height: 60px;
    box-shadow: var(--shadow-md);
}

.nav-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    color: var(--primary);
}
.highlight {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar input {
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    width: 180px;
    transition: all 0.3s;
}
.search-bar input:focus {
    width: 240px;
    border-color: var(--primary);
    outline: none;
    background: var(--card-bg);
}
.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    pointer-events: none;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: var(--secondary);
    transform: rotate(15deg);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, var(--primary-glow), transparent 70%);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 auto 40px;
    flex-wrap: wrap;
    max-width: 1000px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    transition: all 0.2s;
}

.hero-feature:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.check-icon {
    color: var(--success);
    font-size: 1.1rem;
    font-weight: 800;
}

/* Buttons */
.cta-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Tabs */
.category-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.category-tab {
    padding: 10px 28px;
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}
.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Tool Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    padding: 20px 0;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 24px;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.tool-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.icon-pdf { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.icon-image { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.icon-ai { background: rgba(99, 102, 241, 0.1); color: #6366f1; }

.tag {
    position: absolute;
    top: -12px;
    left: 24px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
    z-index: 2;
}

.tag-new { background: var(--accent); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }
.tag-popular { background: var(--success); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.tag-hot { background: var(--warning); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }

.bookmark-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    z-index: 2;
}

.bookmark-btn:hover {
    color: var(--danger);
    background: #fee2e2;
    border-color: #fecaca;
    transform: scale(1.1);
}

/* Tool Workspaces */
.tool-workspace {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 48px;
    margin: 48px 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.tool-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 48px;
}

.tool-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
}

.tool-step span {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.tool-step.active { color: var(--text-main); }
.tool-step.active span {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.upload-area {
    border: 2px dashed var(--border-color);
    padding: 80px 40px;
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--secondary);
    border-style: solid;
}

.upload-icon {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
    color: var(--primary-hover);
}

.upload-btn-real {
    background: var(--primary);
    color: white;
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 12px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.settings-panel {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.result-area {
    text-align: center;
    padding: 40px;
    background: var(--secondary);
    border-radius: var(--radius);
    display: none;
}

/* Floating WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    text-decoration: none;
    transition: all 0.3s;
}

.wa-text {
    background: var(--card-bg);
    color: #25D366;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    border: 1px solid #25D366;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.whatsapp-float:hover .wa-text {
    opacity: 1;
    transform: translateX(0);
}

.wa-icon-box {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s;
}

.whatsapp-float:hover .wa-icon-box {
    transform: scale(1.1) rotate(5deg);
}

.wa-icon-box svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Ad Slot */
.ad-slot {
    width: 100%;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    padding: 20px;
    text-align: center;
    border-radius: var(--radius);
    color: var(--text-muted);
}

/* Footer */
footer {
    margin-top: 100px;
    padding: 60px 0 30px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-links h4 { margin-bottom: 20px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid var(--border-color); color: var(--text-muted); }

/* Mobile */
@media (max-width: 768px) {
    .nav-actions { display: none; }
    .mobile-only { display: block; }
    .desktop-only { display: none; }
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 2px solid var(--primary);
        box-shadow: var(--shadow-lg);
    }
    .nav-links.active { display: flex; }

    .theme-toggle-mobile {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-weight: 500;
        font-size: 1rem;
        padding: 0;
        cursor: pointer;
        text-align: left;
        width: 100%;
    }
    
    .hero { padding: 60px 0 40px; }
    .hero h1 { font-size: 2.2rem; }
    .subtitle { font-size: 1.1rem; margin-bottom: 32px; }
    .hero-features { gap: 10px; }
    .hero-feature { padding: 8px 14px; font-size: 0.8rem; }
    .cta-buttons { flex-direction: column; width: 100%; max-width: 300px; margin: 0 auto; }
    .btn { width: 100%; }
    
    .footer-content { grid-template-columns: 1fr; }
    .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    .wa-icon-box { width: 50px; height: 50px; }
    .wa-icon-box svg { width: 24px; height: 24px; }
}

/* Compression Options Cards */
.compression-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.compression-option {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.compression-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.compression-option.active {
    border-color: var(--primary);
    background: var(--secondary);
    box-shadow: 0 4px 10px var(--primary-glow);
}

.option-icon {
    font-size: 1.5rem;
}

.option-info strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
}

.option-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Button Loading States */
.btn {
    position: relative;
    overflow: hidden;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: btn-spin 0.8s linear infinite;
    position: absolute;
}

.btn.loading .btn-text {
    visibility: hidden;
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

/* Fancy Button Style */
.btn-fancy {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
    z-index: 1;
}

.btn-fancy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.btn-fancy:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

.btn-fancy:hover::after {
    opacity: 1;
}

.btn-fancy:active {
    transform: translateY(-1px) scale(0.98);
}

.download-icon-svg {
    transition: transform 0.3s ease;
}

.btn-fancy:hover .download-icon-svg {
    transform: translateY(3px);
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}


/* Preset and Selection Chips */
.kb-presets {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.kb-preset-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.kb-preset-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
}

.kb-preset-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.kb-preset-btn.active:hover {
    transform: translateY(-2px) scale(1.02);
}

@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; gap: 20px; }
    .tool-workspace { padding: 24px; border-radius: 20px; }
    .upload-area { padding: 40px 20px; }
    .tool-steps { gap: 15px; }
    .tool-step { font-size: 0.8rem; }
    .kb-presets { gap: 8px; }
    .kb-preset-btn { padding: 8px 16px; font-size: 0.85rem; }
}
