/* ============================================
   JastunTools - Master Stylesheet
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --primary-rgb: 79, 70, 229;
    --secondary: #0ea5e9;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* --- Category Bar & Search --- */
.category-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.5rem 0 2rem;
}

.cat-pill {
    padding: 0.5rem 1.15rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    background: #ffffff;
    color: var(--gray-600);
    transition: var(--transition);
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
}

.cat-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cat-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.cat-pill .cat-count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.07);
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.cat-pill.active .cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* --- Live Search Input --- */
.search-wrapper {
    max-width: 620px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.25rem;
    background: #ffffff;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    color: var(--gray-900);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow-md);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12), var(--shadow-md);
}

.search-wrapper input::placeholder {
    color: var(--gray-400);
}

.search-wrapper .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
}

.search-wrapper .search-count {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.tool-cat-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary-light);
    color: var(--primary);
    letter-spacing: 0.5px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--primary-dark);
}


/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--gray-800);
    background-color: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Navbar --- */
#main-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 0;
    z-index: 1050;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-600) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-light);
}

.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* --- Buttons --- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.btn-outline-dark {
    border-width: 2px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.5rem;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    padding: 5rem 0 4rem;
    background: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%);
    overflow: hidden;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray-500);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--gray-300);
}

.hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--gray-200) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* --- Section Styles --- */
.section-header {
    margin-bottom: 3rem;
}

.section-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--gray-500);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Tools Grid --- */
.tools-section {
    padding: 5rem 0;
    background: #fff;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.tool-grid-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-grid-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.tool-grid-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tool-grid-card:hover::before {
    opacity: 1;
}

.tool-grid-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.tool-grid-card:hover .tool-grid-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    transform: scale(1.05);
}

.tool-grid-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.tool-grid-desc {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tool-grid-action {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.tool-grid-card:hover .tool-grid-action {
    letter-spacing: 0.5px;
}

/* --- How It Works --- */
.how-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

.step-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.step-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* --- Features --- */
.features-section {
    padding: 5rem 0;
    background: #fff;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* --- FAQ --- */
.faq-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

.accordion-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius) !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
    padding: 1rem 1.25rem;
    background: #fff;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-light);
}

.accordion-body {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* --- CTA --- */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 50%, var(--secondary) 100%);
    color: #fff;
}

.cta-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.cta-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
}

.footer-brand {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.footer-heading {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-400);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-800);
    color: var(--gray-400);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
}

/* --- Tool Pages --- */
.breadcrumb-section {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
}

.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--gray-500);
}

.breadcrumb-item.active {
    color: var(--primary);
}

.tool-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%);
}

.tool-icon-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    font-size: 2rem;
    color: #fff;
}

.tool-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: 1.05rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Tool Card / Workspace --- */
.tool-workspace {
    padding: 2rem 0 4rem;
}

.tool-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

/* --- Upload Zone --- */
.upload-zone {
    padding: 4rem 2rem;
    text-align: center;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    margin: 1.5rem;
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.upload-zone h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.upload-info {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Processing --- */
.processing-area {
    padding: 2rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* --- Tool Options --- */
.tool-options {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.tool-options .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.tool-options .form-control,
.tool-options .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--gray-300);
    padding: 0.6rem 0.9rem;
}

.tool-options .form-control:focus,
.tool-options .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* --- Results --- */
.results-area {
    padding: 2rem;
}

.result-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.result-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-preview img {
    max-height: 350px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    object-fit: contain;
}

.result-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-stat {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.result-stat .label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.result-stat .value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
}

.result-stat .value.success {
    color: var(--success);
}

.result-stat .value.danger {
    color: var(--danger);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Preview Comparison --- */
.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.preview-box {
    text-align: center;
}

.preview-box .preview-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.preview-box img {
    max-height: 250px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    object-fit: contain;
    background: repeating-conic-gradient(var(--gray-200) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

/* --- Alert Messages --- */
.alert-custom {
    border-radius: var(--radius);
    border: none;
    padding: 1rem 1.5rem;
}

/* --- Image list for multi-upload --- */
.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.image-list-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--gray-200);
    aspect-ratio: 1;
}

.image-list-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-list-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.image-list-item:hover .remove-btn {
    opacity: 1;
}

/* --- Tool FAQ --- */
.tool-faq {
    background: var(--gray-50);
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .navbar-collapse {
        background: #fff;
        border-radius: var(--radius);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .upload-zone {
        padding: 2.5rem 1rem;
        margin: 1rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .preview-comparison {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .cta-title {
        font-size: 1.75rem;
    }
}

/* --- Quality Slider --- */
.quality-slider-container {
    padding: 0.5rem 0;
}

.quality-slider-container input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    height: 6px;
}

.quality-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* --- Lazy Loading Placeholder --- */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
    opacity: 1;
}

/* --- File input drag state --- */
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    transform: scale(1.01);
}

/* --- Checkbox Switch Style --- */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* --- Download all as zip card --- */
.download-all-card {
    background: linear-gradient(135deg, var(--primary-light), #dbeafe);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

/* --- Instagram Reel to Text Tool --- */
.reel-input-zone {
    padding: 3rem 2rem;
    text-align: center;
}

.reel-input-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #E1306C, #F77737, #FCAF45);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 1rem;
}

.reel-input-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.reel-form {
    max-width: 650px;
    margin: 1.5rem auto 0;
}

.reel-url-group {
    border-radius: var(--radius) !important;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.reel-url-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12), var(--shadow-md);
}

.reel-url-group .input-group-text {
    background: #fff;
    border: none;
    color: var(--gray-400);
    font-size: 1.25rem;
    padding-left: 1rem;
}

.reel-url-group .form-control {
    border: none;
    font-size: 0.95rem;
    padding: 0.75rem 0.5rem;
}

.reel-url-group .form-control:focus {
    box-shadow: none;
}

.reel-url-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.reel-url-examples code {
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.reel-processing-animation {
    position: relative;
    display: inline-block;
}

/* --- Transcript Box --- */
.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.transcript-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.transcript-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--gray-700);
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (max-width: 767.98px) {
    .reel-input-zone {
        padding: 2rem 1rem;
    }

    .reel-url-group {
        flex-direction: column;
        border-radius: var(--radius-sm) !important;
    }

    .reel-url-group .input-group-text {
        display: none;
    }

    .reel-url-group .form-control {
        border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    }

    .reel-url-group .btn {
        border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
        width: 100%;
    }
}