@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --secondary-bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success: #16A34A;
    --success-light: #F0FDF4;
    --error: #DC2626;
    --error-light: #FEF2F2;
    --warning: #D97706;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-main);
    line-height: 1.55;
    font-size: 15px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, .h1 { font-size: 2.5rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.025em; line-height: 1.2; }
h2, .h2 { font-size: 1.875rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; }
h3, .h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
h4, .h4 { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
p { color: var(--text-muted); }
.text-main { color: var(--text-main) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Sticky Navbar */
.site-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.nav-link {
    font-size: 14.5px;
    font-weight: 500;
    color: #334155 !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.dropdown-item {
    font-size: 14px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 4.5rem 0 3.5rem 0;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--secondary-bg) 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 9999px;
    margin-bottom: 1.25rem;
    border: 1px solid #BFDBFE;
}

/* Primary and Outline Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    font-size: 14.5px;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: #BFDBFE;
    background-color: #FFFFFF;
    font-weight: 600;
    font-size: 14.5px;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-hover);
}

/* Marketplace Cards */
.tool-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 1rem;
    color: #FFFFFF;
}

/* Drag & Drop Upload Zone */
.upload-container {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.upload-zone {
    border: 2px dashed #93C5FD;
    background-color: #F8FAFC;
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

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

.upload-icon-circle {
    width: 64px;
    height: 64px;
    background-color: #DBEAFE;
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 28px;
}

/* File items list */
.file-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s;
}

.file-item:hover {
    background-color: #F8FAFC;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.file-pdf-icon {
    color: #EF4444;
    font-size: 24px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.file-size {
    font-size: 12.5px;
    color: var(--text-muted);
}

.file-remove-btn {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

.file-remove-btn:hover {
    color: var(--error);
    background-color: var(--error-light);
}

/* Processing Options Card */
.options-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.form-label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-select, .form-control {
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 14px;
    color: var(--text-main);
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
}

/* Status & Results Section */
.status-box {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: none;
}

.status-step-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #DBEAFE;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.progress {
    height: 10px;
    border-radius: 9999px;
    background-color: #E2E8F0;
    overflow: hidden;
}

.progress-bar-animated {
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.stat-card {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}

/* Footer */
.site-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem 0;
    margin-top: auto;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
    display: block;
    margin-bottom: 0.6rem;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-heading {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

/* Interactive Crop Canvas Modal */
.crop-preview-wrapper {
    position: relative;
    max-height: 70vh;
    overflow: auto;
    background: #475569;
    padding: 15px;
    text-align: center;
    border-radius: var(--radius-sm);
}

.crop-canvas {
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: crosshair;
}

/* Multi-Select Label Sorting Order Options Alignment */
.label-sorting-option,
.sorting-option-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 6px 8px !important;
    margin: 0 0 2px 0 !important;
    cursor: pointer !important;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    user-select: none;
}

.label-sorting-option:hover,
.sorting-option-item:hover {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.label-sorting-option input[type="checkbox"],
.sorting-option-item input[type="checkbox"] {
    flex: 0 0 auto !important;
    margin: 0 !important;
    float: none !important;
    width: 1rem !important;
    height: 1rem !important;
    cursor: pointer !important;
}

.label-sorting-option label,
.sorting-option-item label {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    cursor: pointer !important;
    min-width: 0;
    line-height: 1.4;
}

.label-sorting-option label span:first-child,
.sorting-option-item label span:first-child {
    flex: 1 1 auto;
    word-break: break-word;
}

.label-sorting-option label .priority-badge,
.sorting-option-item label .priority-badge {
    flex: 0 0 auto;
    font-size: 0.72rem;
    padding: 3px 6px;
}
