/* ═══════════════════════════════════════════
   2Convert.eu - Design System
   ═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --primary: var(--c-primary, #6366f1);
    --primary-hover: color-mix(in srgb, var(--primary) 85%, #000);
    --primary-light: color-mix(in srgb, var(--primary) 12%, #fff);
    --secondary: var(--c-secondary, #0ea5e9);
    --accent: var(--c-accent, #f59e0b);
    --bg: var(--c-bg, #f8fafc);
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: var(--c-shadow, 0 4px 24px rgba(0,0,0,0.06));
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px color-mix(in srgb, var(--primary) 25%, transparent);
    --radius: var(--c-radius, 12px);
    --radius-lg: calc(var(--radius) + 4px);
    --radius-sm: calc(var(--radius) - 4px);
    --font: var(--c-font, 'DM Sans'), sans-serif;
    --font-heading: var(--c-font-heading, 'Outfit'), sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --max-w: 1200px;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --bg: var(--c-dark-bg, #0f172a);
    --bg-card: #1e293b;
    --bg-elevated: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: #334155;
    --border-hover: #475569;
    --shadow: 0 4px 24px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.3);
    --primary-light: color-mix(in srgb, var(--primary) 15%, #0f172a);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.015em; }
h3 { font-size: 1.35rem; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.main-content { flex: 1; padding: 2rem 0; }

/* ── Navbar ── */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img { height: 32px; }

.navbar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.navbar-nav a, .nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
}

.navbar-nav a:hover, .nav-btn:hover {
    color: var(--text);
    background: var(--primary-light);
}

.navbar-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-right { display: flex; align-items: center; gap: 0.5rem; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    cursor: pointer;
    border: none;
    background: none;
}
.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
    border-radius: 2px;
}

/* Language selector */
.lang-selector {
    position: relative;
}

.lang-selector select {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    padding: 0.4rem 2rem 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Theme toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Search Bar ── */
.search-bar {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ── Hero Section ── */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 { margin-bottom: 0.75rem; font-size: 2.5rem; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto 2rem; }

/* ── Category Tabs ── */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0;
}

.category-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Tool Cards Grid ── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition);
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.3rem;
    color: var(--primary);
    transition: all var(--transition);
}

.tool-card:hover .tool-card-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.tool-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.tool-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.tool-card a {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* AI badge */
.badge-ai {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Tool Page ── */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h1 { margin-bottom: 0.5rem; }
.tool-header p { color: var(--text-muted); }

.tool-interface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    background: var(--bg);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone-icon {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.drop-zone p { color: var(--text-muted); }
.drop-zone strong { color: var(--primary); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: color-mix(in srgb, var(--success) 85%, #000); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }

.btn-block { display: flex; width: 100%; }

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
}
.btn-gradient:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea { min-height: 120px; resize: vertical; }

.form-help { font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }

/* ── Text Area Tool (AI tools) ── */
.text-tool-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-height: 300px;
}

.text-tool-area textarea {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color var(--transition);
}

.text-tool-area textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.text-tool-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

/* ── Alerts ── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success { background: color-mix(in srgb, var(--success) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert-danger { background: color-mix(in srgb, var(--danger) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warning { background: color-mix(in srgb, var(--warning) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.alert-info { background: color-mix(in srgb, var(--info) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* ── File List ── */
.file-list {
    list-style: none;
    margin: 1rem 0;
}

.file-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.file-list li:last-child { border-bottom: none; }
.file-list li i { color: var(--text-light); }

/* ── Result Box ── */
.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    display: none;
}

.result-box.visible { display: block; }
.result-box.success { background: color-mix(in srgb, var(--success) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.result-box.error { background: color-mix(in srgb, var(--danger) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* ── Footer ── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-links a:hover { color: var(--primary); }

.footer-copy {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ── Page Content ── */
.page-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.page-content h1 { margin-bottom: 1.5rem; }
.page-content p { margin-bottom: 1rem; color: var(--text); }
.page-content a { color: var(--primary); }
.page-content ul, .page-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.4rem; }

/* ── Contact Form ── */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    font-family: var(--font);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 0.9rem;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.25s;
}

.modal-overlay.active .modal-box { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .tool-card { padding: 1.15rem; }
    .tool-card-icon { width: 42px; height: 42px; font-size: 1.1rem; }
    .text-tool-area { grid-template-columns: 1fr; }
    .tool-interface { padding: 1.25rem; }
    .page-content { padding: 1.5rem; }

    .hamburger { display: flex; }
    .navbar-nav { display: none; }
    .navbar-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        box-shadow: var(--shadow);
        z-index: 99;
    }

    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .tools-grid { grid-template-columns: 1fr; }
    .category-tabs { gap: 0.35rem; }
    .category-tab { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.4s ease both; }

.tools-grid .tool-card {
    animation: fadeInUp 0.4s ease both;
}
.tools-grid .tool-card:nth-child(1) { animation-delay: 0.02s; }
.tools-grid .tool-card:nth-child(2) { animation-delay: 0.04s; }
.tools-grid .tool-card:nth-child(3) { animation-delay: 0.06s; }
.tools-grid .tool-card:nth-child(4) { animation-delay: 0.08s; }
.tools-grid .tool-card:nth-child(5) { animation-delay: 0.1s; }
.tools-grid .tool-card:nth-child(6) { animation-delay: 0.12s; }
.tools-grid .tool-card:nth-child(n+7) { animation-delay: 0.14s; }

/* ── Code / Monospace ── */
code, pre, .mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* ── Utility classes ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
