/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#uploadZone {
    transition: all 0.2s ease-in-out;
}

#uploadZone.dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
}

/* Sidebar active states */
.tool-btn.active {
    background-color: #eff6ff;
    color: #2563eb;
}

.tool-btn.active i {
    color: #2563eb;
}

/* Image Card Styles */
.image-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    display: flex;
    flex-direction: column;
}

.image-card .preview-container {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8fafc;
    position: relative;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.image-card .card-body {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.image-card .card-title {
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.image-card .card-meta {
    color: #64748b;
    display: flex;
    justify-content: space-between;
}

.status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #f1f5f9;
    color: #475569;
}

.status-badge.processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.done {
    background: #dcfce3;
    color: #15803d;
}

.status-badge.error {
    background: #fee2e2;
    color: #b91c1c;
}

.download-single {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.25rem;
    background: #f1f5f9;
    color: #334155;
    text-align: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.download-single:hover {
    background: #e2e8f0;
}

/* Content Styles for Long-form Pages */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0f172a;
}

.prose {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.75;
    color: var(--slate-700);
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-900);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    font-weight: 600;
    color: var(--slate-900);
}

.prose blockquote {
    border-left: 4px solid var(--slate-200);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--slate-600);
    margin: 2rem 0;
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: var(--primary-hover);
}

.content-section {
    padding: 4rem 1rem;
    background: white;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--slate-400);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--slate-600);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.footer {
    background: white;
    border-top: 1px solid var(--slate-200);
    padding: 3rem 1rem;
    margin-top: 4rem;
}

/* UI Cleanup & Premium Aesthetics */
.shadow-premium {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.shadow-soft {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.config-section {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar .tool-btn {
    transition: all 0.2s;
}

#sidebar .tool-btn:hover:not(.active) {
    background-color: var(--slate-100);
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    height: 1.25rem;
    width: 1.25rem;
    background-color: #fff;
    border-radius: 4px;
    border: 2px solid var(--slate-300);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 0.75rem;
}

.preset-chip {
    padding: 0.375rem 0.75rem;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-chip:hover {
    background-color: #e2e8f0;
    color: var(--primary);
}

.preset-chip.active {
    background-color: var(--primary);
    color: white;
}

/* --- SEO & UI Final Polish Additions --- */

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid #cbd5e1;
    min-width: 300px;
    animation: toast-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.success {
    border-left-color: #22c55e;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: var(--primary);
}

.toast i {
    font-size: 1.125rem;
}

.toast.success i {
    color: #22c55e;
}

.toast.error i {
    color: #ef4444;
}

.toast.info i {
    color: var(--primary);
}

/* Thumbnail Grid */
.thumb-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    background: var(--slate-50);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumb-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item .remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--slate-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--slate-200);
    opacity: 0;
    transform: scale(0.8);
}

.thumb-item:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

.thumb-item .remove-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.thumb-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

/* Accordion Logic */
#advancedSettings {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

#advancedSettings.open {
    max-height: 2000px;
    opacity: 1;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

/* Format Buttons */
.format-option {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.format-option:hover:not(.border-primary) {
    background: var(--slate-50);
    border-color: var(--slate-200);
    transform: translateY(-1px);
}