/* ═══════════════════════════════════════════════════════════════
   Premium Tool Styles — Inspired by Mixilab, VideoTools, SmallPDF
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #E60023;
    --primary-dark: #C2001D;
    --primary-light: #FF4D6A;
    --primary-bg: #FFF0F2;
    --primary-gradient: linear-gradient(135deg, #E60023 0%, #FF4D6A 100%);
    --accent: #6366F1;
    --accent-light: #818CF8;
    --accent-bg: #EEF2FF;
    --bg: #FFFFFF;
    --bg-alt: #F8FAFC;
    --bg-elevated: #FFFFFF;
    --bg-dark: #0F172A;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --error: #EF4444;
    --error-bg: #FEF2F2;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-alt);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ═══ TOOL HEADER ═══ */
.tool-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tool-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tool-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: var(--transition);
    white-space: nowrap;
}
.tool-back:hover { background: var(--primary-bg); color: var(--primary); }
.tool-back svg { width: 16px; height: 16px; }
.tool-header h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-header-badge {
    margin-left: auto;
    padding: 5px 14px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-transform: uppercase;
}

/* ═══ TOOL HERO ═══ */
.tool-hero {
    position: relative;
    overflow: hidden;
    padding: 60px 24px 48px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.tool-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(230,0,35,0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(99,102,241,0.03) 0%, transparent 60%);
    pointer-events: none;
    animation: heroFloat 20s ease-in-out infinite alternate;
}
@keyframes heroFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, 2%) rotate(1deg); }
}
.tool-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(230,0,35,0.25);
    position: relative;
    z-index: 1;
    animation: iconPulse 3s ease-in-out infinite alternate;
}
@keyframes iconPulse {
    0% { box-shadow: 0 8px 24px rgba(230,0,35,0.25); }
    100% { box-shadow: 0 12px 32px rgba(230,0,35,0.35); }
}
.tool-hero-icon svg { width: 32px; height: 32px; }
.tool-hero h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.tool-hero p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* ═══ TOOL CONTAINER ═══ */
.tool-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 60px;
    position: relative;
    z-index: 1;
}

/* ═══ UPLOAD ZONE ═══ */
.upload-zone {
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-2xl);
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}
.upload-zone:hover {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(230,0,35,0.02) 0%, rgba(255,77,106,0.02) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 4px rgba(230,0,35,0.1);
    transform: scale(1.01);
}
.upload-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
    padding: 24px;
}
.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 18px;
    margin-bottom: 18px;
    transition: var(--transition);
}
.upload-zone:hover .upload-icon {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(230,0,35,0.12) 0%, rgba(255,77,106,0.08) 100%);
}
.upload-icon svg { width: 28px; height: 28px; }
.upload-zone h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}
.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.5;
}
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary-gradient);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(230,0,35,0.3);
}
.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,0,35,0.4);
}
.upload-btn:active { transform: translateY(0); }
.upload-btn svg { width: 18px; height: 18px; }
.upload-formats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.upload-format-tag {
    padding: 3px 10px;
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
#fileInput { display: none; }

/* ═══ FILE INFO ═══ */
.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}
.file-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-icon svg { width: 22px; height: 22px; }
.file-details { flex: 1; min-width: 0; }
.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-remove:hover { background: var(--error-bg); color: var(--error); }

/* ═══ SECTION CARDS ═══ */
.section-card {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    animation: fadeInUp 0.4s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-card h3 svg { width: 18px; height: 18px; color: var(--primary); }

/* ═══ PREVIEW ═══ */
.preview-media {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: var(--bg-dark);
    border-radius: var(--radius);
    display: block;
}

/* ═══ CONTROLS ═══ */
.control-group { margin-bottom: 18px; }
.control-group:last-child { margin-bottom: 0; }
.control-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.control-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.control-input {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text);
}
.control-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,0,35,0.1);
}
.control-select {
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    min-width: 140px;
    transition: var(--transition);
}
.control-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,0,35,0.1);
}
.control-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Range Slider */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.range-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    transition: var(--transition);
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(230,0,35,0.3);
    transition: var(--transition);
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(230,0,35,0.4);
}
.range-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    min-width: 56px;
    text-align: center;
    padding: 4px 8px;
    background: var(--bg-alt);
    border-radius: 6px;
}

/* ═══ PRESET BUTTONS ═══ */
.preset-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.preset-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    background: var(--bg-alt);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.preset-btn.active {
    border-color: var(--primary);
    color: white;
    background: var(--primary);
}

/* ═══ ACTION BUTTONS ═══ */
.action-section {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.action-btn svg { width: 18px; height: 18px; }
.action-btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(230,0,35,0.3);
}
.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230,0,35,0.4);
}
.action-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.action-btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.action-btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}
.action-btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.action-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16,185,129,0.4);
}
.action-btn-full {
    width: 100%;
    justify-content: center;
}

/* ═══ PROCESSING OVERLAY ═══ */
.processing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.processing-overlay.active { display: flex; }
.processing-card {
    background: var(--bg);
    border-radius: var(--radius-2xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.3s ease-out;
}
.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
.processing-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.processing-card p { font-size: 13px; color: var(--text-secondary); }
.processing-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}
.processing-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ RESULT DOWNLOAD ═══ */
.result-download {
    display: none;
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}
.result-download.active { display: block; }
.result-success-icon {
    width: 64px;
    height: 64px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.result-success-icon svg { width: 28px; height: 28px; }
.result-download h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.result-download .result-size { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.download-final-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.download-final-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16,185,129,0.4);
}
.download-final-btn svg { width: 20px; height: 20px; }

/* ═══ FEATURES GRID ═══ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 40px;
}
.feature-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-icon.red { background: var(--primary-bg); color: var(--primary); }
.feature-icon.blue { background: var(--accent-bg); color: var(--accent); }
.feature-icon.green { background: var(--success-bg); color: var(--success); }
.feature-icon.yellow { background: #FEF3C7; color: #D97706; }
.feature-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.feature-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ═══ STEPS ═══ */
.steps-section {
    margin-top: 48px;
}
.steps-section h2 {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.step-card {
    text-align: center;
    padding: 24px 16px;
    position: relative;
}
.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(230,0,35,0.25);
}
.step-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ═══ FAQ ═══ */
.faq-section {
    margin-top: 48px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.faq-section h2 {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
}
.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg);
    overflow: hidden;
    transition: var(--transition);
}
.faq-item:hover { border-color: var(--border); }
.faq-question {
    width: 100%;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.faq-question svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-answer-inner {
    padding: 0 20px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ═══ TRUST BAR ═══ */
.trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 0;
    margin-top: 24px;
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.trust-item svg { width: 16px; height: 16px; color: var(--success); }

/* ═══ TEXTAREA ═══ */
.tool-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    font-size: 14px;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
    line-height: 1.6;
}
.tool-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,0,35,0.1);
}

/* ═══ FLASHCARD STYLES ═══ */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.flashcard {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 180px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    perspective: 1000px;
}
.flashcard:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 140px;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 10px;
}
.flashcard-text { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.5; }
.flashcard-hint {
    position: absolute;
    bottom: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ═══ AI TUTOR CHAT ═══ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background: var(--bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease-out;
}
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.chat-message.user .chat-avatar { background: var(--primary-bg); color: var(--primary); }
.chat-message.ai .chat-avatar { background: var(--accent-bg); color: var(--accent); }
.chat-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
}
.chat-message.user .chat-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-message.ai .chat-bubble { background: var(--bg-alt); color: var(--text); border-bottom-left-radius: 4px; }
.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
}
.chat-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    background: var(--bg-alt);
    color: var(--text);
    transition: var(--transition);
}
.chat-input:focus { border-color: var(--primary); background: var(--bg); }
.chat-send {
    padding: 12px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}
.chat-send:hover { box-shadow: 0 4px 12px rgba(230,0,35,0.3); }

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateY(120%);
    transition: transform 0.3s ease;
    max-width: 360px;
}
.toast.show { transform: translateY(0); }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .tool-header-inner { padding: 0 16px; }
    .tool-header h1 { font-size: 14px; }
    .tool-hero { padding: 40px 20px 32px; }
    .tool-hero h2 { font-size: 22px; }
    .tool-hero p { font-size: 14px; }
    .tool-container { padding: 0 16px 40px; }
    .upload-zone { padding: 40px 20px; border-radius: var(--radius-xl); }
    .section-card { padding: 20px; }
    .control-row { flex-direction: column; }
    .control-input, .control-select { width: 100%; min-width: 0; }
    .action-section { flex-direction: column; }
    .action-btn { width: 100%; }
    .steps-grid { grid-template-columns: 1fr; gap: 16px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .feature-card { padding: 16px 12px; }
    .flashcards-grid { grid-template-columns: 1fr; }
    .chat-container { height: 400px; }
    .chat-message { max-width: 95%; }
    .trust-bar { gap: 16px; }
    .result-download { padding: 24px 16px; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
    .tool-header-badge { display: none; }
}

/* ═══ DARK MODE ═══ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F172A;
        --bg-alt: #1E293B;
        --bg-elevated: #1E293B;
        --bg-dark: #0B1120;
        --text: #F1F5F9;
        --text-secondary: #94A3B8;
        --text-muted: #64748B;
        --border: #334155;
        --border-light: #1E293B;
        --primary-bg: rgba(230,0,35,0.12);
        --success-bg: rgba(16,185,129,0.12);
        --accent-bg: rgba(99,102,241,0.12);
        --error-bg: rgba(239,68,68,0.12);
    }
    .tool-header { background: rgba(15,23,42,0.85); }
    .upload-zone { background: var(--bg-elevated); }
    .upload-zone:hover { background: var(--bg-elevated); }
    .section-card { background: var(--bg-elevated); }
    .feature-card { background: var(--bg-elevated); }
    .faq-item { background: var(--bg-elevated); }
    .flashcard { background: var(--bg-elevated); }
    .chat-container { background: var(--bg-elevated); }
    .control-input, .control-select, .tool-textarea {
        background: var(--bg-elevated);
        color: var(--text);
    }
    .chat-input { background: var(--bg); }
    .processing-card { background: var(--bg-elevated); }
    .result-download { background: var(--bg-elevated); }
    .chat-message.ai .chat-bubble { background: var(--bg); }
}
