/* ========================================
   MyExamPhoto - Refined Professional Stylesheet
   Clean, minimal, trustworthy design
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #111827;
    --text-medium: #374151;
    --text-light: #64748b;
    --text-lighter: #9ca3af;
    --bg-page: #f9fafb;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
}

/* ========================================
   TYPOGRAPHY SCALE
   ======================================== */

h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--text-medium);
}

a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   MAIN PAGE CONTAINER (1100px max-width)
   ======================================== */

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Section spacing */
.content-section {
    padding: 3rem 0;
}

.seo-content-wrapper {
    background: var(--bg-white);
    padding: 3rem 0;
}

/* ========================================
   Full-Width Site Header (Sticky)
   ======================================== */

.site-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    height: 64px;
}

/* Logo with SVG Icon */
.logo-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo svg {
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.secure-badge {
    background: #ecfdf5;
    color: #047857;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.secure-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

/* ========================================
   Hero Section (H1)
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #6366f1 100%);
    padding: 3.5rem 0;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.main-heading {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* ========================================
   Main Grid Layout
   ======================================== */

.main-wrapper {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-white);
    box-shadow: 0 -4px 20px rgba(91, 33, 182, 0.08);
    border-radius: 16px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 64px - 120px);
    margin: 2rem;
    padding: 2rem;
    background: var(--bg-gray);
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 33.333% 66.667%;
    }
}

.section {
    border-bottom: 1px solid var(--border-light);
    padding: 2rem;
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   FORM INPUTS (Enhanced for readability)
   ======================================== */

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    background: var(--bg-white);
    color: var(--text-dark);
    caret-color: var(--text-dark);
    line-height: 1.5;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
textarea:hover,
select:hover {
    border-color: var(--primary-light);
    background-color: #ffffff;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #ffffff;
    color: var(--text-dark);
    caret-color: var(--text-dark);
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-medium);
}

#photoInput {
    display: none;
}

.hidden {
    display: none !important;
}

/* ========================================
   Right Panel - Visual Stage
   ======================================== */

.visual-stage {
    background: var(--bg-white);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 600px;
}

/* ========================================
   Upload State
   ======================================== */

.upload-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.upload-zone {
    width: 100%;
    max-width: 600px;
    border: 3px dashed var(--border-medium);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-light);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.upload-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.upload-formats {
    font-size: 0.875rem;
    color: var(--text-lighter);
}

.upload-error {
    margin-top: 1rem;
    padding: 0.875rem 1.25rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    text-align: center;
}

.upload-error.visible {
    display: block;
    animation: errorSlideIn 0.3s ease;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Global Drop Overlay
   ======================================== */

.drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(37, 99, 235, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.drop-overlay.active {
    display: flex;
}

.drop-overlay-content {
    text-align: center;
    color: white;
}

.drop-overlay-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem;
    color: white;
}

.drop-overlay-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.drop-overlay-hint {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ========================================
   Cropper Section
   ======================================== */

#cropperSection {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.cropper-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.crop-info {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.crop-info p {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.cropper-container-wrapper {
    width: 100%;
    height: 50dvh;
    min-height: 300px;
    background-color: #f8fafc;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--shadow-md);
}

@media (min-width: 1024px) {
    .cropper-container-wrapper {
        height: 600px;
    }
}

#cropperImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* ========================================
   Output Section
   ======================================== */

#output {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.output-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-container {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.preview-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

#preview {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: 8px;
}

.info-item {
    background: var(--bg-white);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: center;
    text-align: center;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.info-item strong {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ========================================
   BUTTONS (Consistent Design)
   ======================================== */

.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--primary-dark);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--text-medium);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--text-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary:active {
    background: var(--text-dark);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-medium);
    color: var(--text-medium);
}

.btn-outline:hover {
    border-color: var(--text-medium);
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-outline:active {
    background: var(--bg-white);
}

.btn-remove {
    background: var(--danger);
    color: white;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.btn-remove:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-remove:active {
    background: #dc2626;
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
}

.action-buttons {
    padding: 2rem 1.5rem;
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-light);
}

.about-section h2,
.how-to-section h2,
.exams-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.about-section p,
.how-to-section p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-medium);
    margin-bottom: 1rem;
}

/* Privacy Callout Badge */
.privacy-callout {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.privacy-callout svg {
    flex-shrink: 0;
    color: #059669;
}

.privacy-callout span {
    font-size: 0.95rem;
    color: #065f46;
    line-height: 1.5;
}

.privacy-callout strong {
    font-weight: 600;
}

/* Improved Steps List */
.steps-list-improved {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
    margin: 1.5rem 0;
}

.steps-list-improved li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-medium);
}

.steps-list-improved li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.steps-list-improved li strong {
    color: var(--text-dark);
}

.offline-note {
    background: #f0f9ff;
    border-left: 4px solid #0284c7;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #075985;
}

/* Improved Exam Grid */
.exam-grid-improved {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.exam-category-improved h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.exam-category-improved ul {
    list-style: none;
    padding-left: 0;
}

.exam-category-improved li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-medium);
}

.exam-category-improved li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* FAQ Section */
.faq-item {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.faq-item p {
    margin-bottom: 0;
    color: var(--text-medium);
    line-height: 1.7;
}

/* Trust Signals */
.trust-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    border-radius: 12px;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.trust-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trust-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.trust-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.trust-item p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ========================================
   Full-Width Site Footer
   ======================================== */

.site-footer {
    width: 100%;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    margin-top: 3rem;
}

.footer {
    text-align: center;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

.footer-trust {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-lighter);
}

.footer-copyright a {
    color: var(--primary);
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* ========================================
   Choices.js Custom Styling
   ======================================== */

.choices {
    margin-bottom: 0;
}

.choices__inner {
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    min-height: auto;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.choices__inner:hover {
    border-color: var(--primary-light);
}

.choices.is-focused .choices__inner {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.choices__list--dropdown {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-top: 0.25rem;
}

.choices__item--selectable {
    padding: 0.625rem 0.875rem;
}

.choices__item--selectable.is-highlighted {
    background: var(--primary);
}

/* ========================================
   Failure Modal Styles
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc2626;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    text-align: center;
}

.modal-image-wrapper {
    margin-bottom: 1.25rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 8px;
    display: inline-block;
}

#failureImage {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    object-fit: contain;
}

.modal-message {
    color: var(--text-dark);
    line-height: 1.5;
    margin: 0;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========================================
   Layout Fixes
   ======================================== */

.controls-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.controls-content::-webkit-scrollbar {
    width: 6px;
}

.controls-content::-webkit-scrollbar-track {
    background: transparent;
}

.controls-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1023px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .visual-stage {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .exam-grid {
        grid-template-columns: 1fr;
    }


    .logo img {
        width: 28px !important;
        height: 28px !important;
    }

    .logo-name {
        font-size: 0.95rem !important;
    }

    .secure-badge {
        font-size: 0.55rem !important;
        padding: 0.3rem 0.5rem !important;
    }
}

/* ========================================
   Mobile Hamburger Menu Styles
   ======================================== */

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-dark);
    line-height: 1;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 0.5rem 0;
    width: 100%;
}

.mobile-nav.is-open {
    display: flex;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav a {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    display: block;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

@media (max-width: 640px) {
    .hamburger {
        display: block;
    }

    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: wrap;
    }

    .header-right {
        margin-left: auto;
        display: flex !important;
        align-items: center;
        gap: 0.5rem !important;
    }
}

/* SVG Icons - ensure proper rendering */
.upload-icon-svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS
   Add this to the END of your styles.css file
   ======================================== */

/* TRUST GRID - Missing from current file */
@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MOBILE LAYOUT (max-width: 640px)
   ======================================== */

@media (max-width: 640px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Container adjustments */
    .container,
    .page-container {
        padding: 0 1rem;
        max-width: 100%;
    }

    /* Main layout spacing */
    .main-wrapper {
        margin: 1rem auto;
        padding: 1rem;
        border-radius: 12px;
    }

    .main-grid {
        margin: 0;
        padding: 1rem;
        gap: 2rem;
    }

    /* Hero section */
    .hero-section {
        padding: 2rem 1rem;
    }

    .main-heading {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0;
    }

    /* Typography */
    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Header */
    .logo-tagline {
        display: none;
    }

    .header {
        padding: 0.5rem 0;
        min-height: 52px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .logo-name {
        font-size: 1rem;
    }

    .header-right a {
        display: none;
    }

    .secure-badge {
        font-size: 0.6rem;
        padding: 0.35rem 0.6rem;
    }

    .secure-dot {
        width: 6px;
        height: 6px;
    }

    /* Controls and Visual Stage */
    .controls-panel,
    .visual-stage {
        padding: 1.5rem 1rem;
    }

    .section {
        padding: 1.5rem 1rem;
    }

    /* FORMS - FULL WIDTH WITH PROPER TAP TARGETS */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    textarea,
    select {
        padding: 0.75rem;
        font-size: 1rem;
        /* Prevents zoom on iOS */
    }

    /* BUTTONS - FULL WIDTH */
    .btn {
        width: 100%;
        padding: 0.875rem 1rem;
        min-height: 44px;
        /* Apple's recommended tap target */
    }

    .btn-full {
        width: 100%;
    }

    .action-buttons {
        gap: 0.875rem;
    }

    /* Upload zone */
    .upload-container {
        padding: 2rem 1rem;
    }

    .upload-zone {
        padding: 3rem 1.5rem;
        border-radius: 16px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 1.25rem;
    }

    .upload-hint {
        font-size: 0.9rem;
    }

    .upload-formats {
        font-size: 0.8rem;
    }

    /* Cropper */
    .cropper-container-wrapper {
        height: 40dvh;
        min-height: 280px;
    }

    .crop-info {
        padding: 0.875rem 1rem;
    }

    .crop-info p {
        font-size: 0.85rem;
    }

    /* Output section */
    .preview-container {
        padding: 1.5rem 1rem;
    }

    #preview {
        max-height: 250px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.875rem;
    }

    .info-item {
        padding: 0.875rem 1rem;
    }

    /* SEO Content */
    .seo-content-wrapper {
        padding: 2rem 0;
    }

    .content-section {
        padding: 2rem 0;
    }

    .about-content-wrapper {
        padding: 1.5rem 1rem;
    }

    .about-section h2,
    .how-to-section h2,
    .exams-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .about-section p,
    .how-to-section p {
        font-size: 0.95rem;
    }

    /* Privacy callout */
    .privacy-callout {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.875rem;
    }

    .privacy-callout span {
        font-size: 0.875rem;
    }

    /* Steps list */
    .steps-list-improved li {
        padding-left: 2.5rem;
        font-size: 0.9rem;
    }

    .steps-list-improved li::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }

    .offline-note {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }

    /* Exam grid - single column */
    .exam-grid-improved {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .exam-category-improved h3 {
        font-size: 1.05rem;
    }

    .exam-category-improved li {
        font-size: 0.9rem;
    }

    /* FAQ */
    .faq-item {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    .faq-item p {
        font-size: 0.9rem;
    }

    /* Trust grid - single column */
    .trust-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .trust-item {
        padding: 1.25rem 1rem;
    }

    .trust-item strong {
        font-size: 1rem;
    }

    .trust-item p {
        font-size: 0.875rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }

    .footer-trust {
        font-size: 0.875rem;
        padding: 0 1rem;
    }

    .footer-copyright {
        font-size: 0.8rem;
        padding: 0 1rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }

    /* Choices.js */
    .choices__inner {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .choices__list--dropdown {
        max-height: 250px;
    }

    /* Prevent overflow */
    .main-grid,
    .visual-stage,
    .controls-panel,
    .output-wrapper,
    .preview-container,
    .about-content-wrapper {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Checkbox - better tap targets */
    .checkbox-group {
        padding: 0.5rem 0;
    }

    .checkbox-group input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
    }

    .checkbox-group label {
        font-size: 0.95rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .logo img {
        width: 28px;
        height: 28px;
    }

    .logo-name {
        font-size: 0.95rem;
    }

    .secure-badge {
        font-size: 0.55rem;
        padding: 0.3rem 0.5rem;
    }

    .main-heading {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .container,
    .page-container {
        padding: 0 0.875rem;
    }

    .main-wrapper {
        padding: 0.875rem;
    }

    .section {
        padding: 1.25rem 0.875rem;
    }

    .upload-zone {
        padding: 2.5rem 1rem;
    }

    .btn {
        font-size: 0.95rem;
    }
}

/* ========================================
   DESKTOP NAVIGATION - Tools Dropdown
   ======================================== */

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 641px) {
    .nav-menu {
        display: flex;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

/* Dropdown Container */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

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

/* ========================================
   MOBILE NAVIGATION - Updated Styles
   ======================================== */

@media (max-width: 640px) {
    .nav-menu {
        display: none;
    }
}

.mobile-nav-link {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    display: block;
    font-size: 0.95rem;
}

.mobile-nav-link:hover {
    background-color: var(--bg-gray);
    color: var(--primary);
}

.mobile-tools-section {
    background-color: var(--bg-gray);
    padding: 0.5rem 0;
}

.mobile-section-title {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.mobile-tool-link {
    display: block;
    padding: 0.625rem 1rem 0.625rem 2rem;
    text-decoration: none;
    color: var(--text-medium);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-tool-link:hover {
    background-color: #ffffff;
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ========================================
   TOOLS HUB SECTION
   ======================================== */

.tools-section {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 4rem 0;
    border-top: 1px solid var(--border-light);
}

.tools-section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 0.75rem;
}

.tools-section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Tools Grid - Auto-fits any number of tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tool Card - Link Element */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

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

/* Active/Popular Tool Card */
.tool-card-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

/* Tool Badge (Popular) */
.tool-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Coming Soon Badge */
.tool-badge-soon {
    background: linear-gradient(135deg, #c19a00 0%, #8b6508 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(139, 101, 8, 0.35);
}


/* Tool Icon */
.tool-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Tool Title */
.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Tool Description */
.tool-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Tool Arrow */
.tool-card-arrow {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    align-self: flex-start;
    transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-arrow {
    transform: translateX(4px);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .tools-section {
        padding: 3rem 0;
    }

    .tools-section-heading {
        font-size: 1.75rem;
    }

    .tools-section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .tools-grid {
        gap: 1.25rem;
    }

    .tool-card {
        padding: 1.5rem 1.25rem;
    }

    .tool-card-icon {
        font-size: 2.25rem;
    }

    .tool-card-title {
        font-size: 1rem;
    }

    .tool-card-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .tools-section {
        padding: 2.5rem 0;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tool-card {
        padding: 1.25rem 1rem;
    }
}

/* ========================================
   DPI Converter Specific Styles
   ======================================== */

.drag-active {
    border-color: var(--primary) !important;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-tool-link:hover {
    background-color: #ffffff;
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ========================================
   TOOLS HUB SECTION
   ======================================== */

.tools-section {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 4rem 0;
    border-top: 1px solid var(--border-light);
}

.tools-section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 0.75rem;
}

.tools-section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Tools Grid - Auto-fits any number of tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tool Card - Link Element */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

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

/* Active/Popular Tool Card */
.tool-card-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

/* Tool Badge (Popular) */
.tool-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Coming Soon Badge */
.tool-badge-soon {
    background: linear-gradient(135deg, #c19a00 0%, #8b6508 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(139, 101, 8, 0.35);
}


/* Tool Icon */
.tool-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Tool Title */
.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Tool Description */
.tool-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Tool Arrow */
.tool-card-arrow {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    align-self: flex-start;
    transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-arrow {
    transform: translateX(4px);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .tools-section {
        padding: 3rem 0;
    }

    .tools-section-heading {
        font-size: 1.75rem;
    }

    .tools-section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .tools-grid {
        gap: 1.25rem;
    }

    .tool-card {
        padding: 1.5rem 1.25rem;
    }

    .tool-card-icon {
        font-size: 2.25rem;
    }

    .tool-card-title {
        font-size: 1rem;
    }

    .tool-card-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .tools-section {
        padding: 2.5rem 0;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tool-card {
        padding: 1.25rem 1rem;
    }
}

/* ========================================
   DPI Converter Specific Styles
   ======================================== */

.drag-active {
    border-color: var(--primary) !important;
    background-color: #eff6ff !important;
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

#dpiInput {
    display: none;
}


/* ========================================
   TOOLS HUB SECTION
   ======================================== */

.tools-section {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 4rem 0;
    border-top: 1px solid var(--border-light);
}

.tools-section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 0.75rem;
}

.tools-section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Tools Grid - Auto-fits any number of tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tool Card - Link Element */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

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

/* Active/Popular Tool Card */
.tool-card-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

/* Tool Badge (Popular) */
.tool-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Coming Soon Badge */
.tool-badge-soon {
    background: linear-gradient(135deg, #c19a00 0%, #8b6508 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(139, 101, 8, 0.35);
}


/* Tool Icon */
.tool-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Tool Title */
.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Tool Description */
.tool-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Tool Arrow */
.tool-card-arrow {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    align-self: flex-start;
    transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-arrow {
    transform: translateX(4px);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .tools-section {
        padding: 3rem 0;
    }

    .tools-section-heading {
        font-size: 1.75rem;
    }

    .tools-section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .tools-grid {
        gap: 1.25rem;
    }

    .tool-card {
        padding: 1.5rem 1.25rem;
    }

    .tool-card-icon {
        font-size: 2.25rem;
    }

    .tool-card-title {
        font-size: 1rem;
    }

    .tool-card-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .tools-section {
        padding: 2.5rem 0;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tool-card {
        padding: 1.25rem 1rem;
    }
}

/* ========================================
   DPI Converter Specific Styles
   ======================================== */

.drag-active {
    border-color: var(--primary) !important;
    background-color: #eff6ff !important;
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

#dpiInput {
    display: none;
}

/* ========================================
   File Converter Styles
   ======================================== */

.converter-container {
    max-width: 800px;
    margin: 0 auto;
}

.converter-header {
    margin-bottom: 2rem;
    text-align: center;
}

.conversion-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    min-width: 200px;
}

.control-arrow {
    font-size: 1.5rem;
    color: var(--text-light);
    padding-top: 1.5rem;
}

/* Queue Card Styles */
.file-queue-section {
    margin-top: 2rem;
}

.queue-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-gray);
}

.queue-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

/* Queue Columns Grid */
.queue-column-headers {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.file-list-wrapper {
    position: relative;
    min-height: 100px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.file-item:last-child {
    border-bottom: none;
}

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

.file-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.file-status-cell {
    display: flex;
    align-items: center;
}

.file-actions-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.status-converting {
    background: #dbeafe;
    color: #2563eb;
}

.status-done {
    background: #d1fae5;
    color: #059669;
}

.status-error {
    background: #fee2e2;
    color: #dc2626;
}

/* Empty State */
.queue-empty-state {
    display: none;
    /* Toggled by JS or CSS */
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Footer Actions */
.queue-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-gray);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    /* Align right on desktop */
}

.global-actions {
    display: flex;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
    .conversion-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
        text-align: center;
    }

    /* Stack queue items on mobile */
    .queue-column-headers {
        display: none;
        /* Hide headers on mobile */
    }

    .file-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
    }

    .file-info {
        margin-bottom: 0.25rem;
    }

    .file-meta,
    .file-status-cell {
        font-size: 0.8rem;
    }

    .file-actions-cell {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .queue-footer {
        justify-content: center;
    }

    .global-actions {
        flex-direction: column;
        width: 100%;
    }

    .global-actions button {
        width: 100%;
    }
}

/* ========================================
   FILE CONVERTER REFACTOR STYLES
   ======================================== */

/* Hide native file input */
#fileInput {
    display: none;
}

/* Hide queue section by default (JS will show it) */
#fileQueueSection {
    display: none;
}

/* Empty state styling */
.queue-empty-state {
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-light, #6b7280);
}

/* Shared grid layout for header and rows */
.file-queue-columns,
.file-queue-list .file-item {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 2fr);
    column-gap: 1rem;
    align-items: center;
}

.file-queue-columns {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light, #6b7280);
    padding: 0.5rem 1rem;
    background-color: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.file-queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-queue-list .file-item {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.file-queue-list .file-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main, #111827);
    word-break: break-all;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-light, #6b7280);
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: flex-start;
    flex-wrap: wrap;
}

@media (max-width: 640px) {

    .file-queue-columns,
    .file-queue-list .file-item {
        grid-template-columns: minmax(0, 3fr) minmax(0, 1.5fr) minmax(0, 2fr);
    }

    .file-queue-columns span:last-child {
        display: none;
        /* hide ACTIONS label on small screens */
    }
}

/* Download button styling */
.btn-download-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background-color: var(--primary, #2563eb);
    color: #ffffff;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-download-sm:hover {
    background-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-download-sm:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-download-sm:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Remove button styling */
.btn-remove-sm {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-light, #6b7280);
}

.btn-remove-sm:hover {
    color: #ef4444;
}

/* === FILE QUEUE COLUMN ALIGNMENT FIX (UNIVERSAL FILE CONVERTER ONLY) === */

.file-queue-columns,
.file-queue-list .file-item {
    display: grid;
    grid-template-columns: 4fr 1.5fr 1.5fr 2fr;
    align-items: center;
    column-gap: 1rem;
}

/* Force each inner block into its correct grid column */
.file-queue-list .file-item .file-info {
    grid-column: 1;
}

.file-queue-list .file-item .file-meta,
.file-queue-list .file-item .file-size {
    grid-column: 2;
}

.file-queue-list .file-item .status-badge {
    grid-column: 3;
}

.file-queue-list .file-item .file-status {
    grid-column: 4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: flex-start;
}

/* Ensure header labels align with same grid */
.file-queue-columns {
    padding: 0.6rem 1rem;
    background-color: #f9fafb;
    border-radius: 8px 8px 0 0;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-light, #6b7280);
}

/* Row padding consistency */
.file-queue-list .file-item {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.file-queue-list .file-item:last-child {
    border-bottom: none;
}

/* Mobile stacking only below 640px */
@media (max-width: 640px) {

    .file-queue-columns,
    .file-queue-list .file-item {
        grid-template-columns: 1fr;
        row-gap: 0.4rem;
    }

    .file-queue-columns {
        display: none;
    }

    .file-queue-list .file-item .file-info,
    .file-queue-list .file-item .file-meta,
    .file-queue-list .file-item .status-badge,
    .file-queue-list .file-item .file-status {
        grid-column: auto;
    }

    /* === FINAL ALIGNMENT FIX FOR FILE QUEUE ROWS === */

    /* Make each row a 4-column grid matching the header */
    .file-queue-list .file-item {
        display: grid;
        grid-template-columns: 4fr 1.5fr 1.5fr 2fr;
        align-items: center;
        column-gap: 1rem;
        padding: 0.6rem 1rem;
    }

    /* Let the inner wrappers disappear for layout so children sit on the grid */
    .file-queue-list .file-item .file-info,
    .file-queue-list .file-item .file-status {
        display: contents;
    }

    /* Column 1: File name */
    .file-queue-list .file-item .file-name {
        grid-column: 1;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-main, #111827);
        word-break: break-all;
    }

    /* Column 2: Size */
    .file-queue-list .file-item .file-meta {
        grid-column: 2;
        text-align: center;
        font-size: 0.8rem;
        color: var(--text-light, #6b7280);
    }

    /* Column 3: Status badge */
    .file-queue-list .file-item .status-badge {
        grid-column: 3;
        justify-self: center;
    }

    /* Column 4: Actions (Download + remove + error icon if any) */
    .file-queue-list .file-item .btn-download-sm,
    .file-queue-list .file-item .btn-remove-sm,
    .file-queue-list .file-item .error-msg {
        grid-column: 4;
        justify-self: flex-start;
    }

    /* Keep header grid consistent with rows */
    .file-queue-columns {
        display: grid;
        grid-template-columns: 4fr 1.5fr 1.5fr 2fr;
        column-gap: 1rem;
        padding: 0.6rem 1rem;
    }

    /* Mobile: stack everything neatly */
    @media (max-width: 640px) {
        .file-queue-columns {
            display: none;
        }

        .file-queue-list .file-item {
            grid-template-columns: 1fr;
            row-gap: 0.3rem;
        }

        .file-queue-list .file-item .file-name,
        .file-queue-list .file-item .file-meta,
        .file-queue-list .file-item .status-badge,
        .file-queue-list .file-item .btn-download-sm,
        .file-queue-list .file-item .btn-remove-sm,
        .file-queue-list .file-item .error-msg {
            grid-column: 1;
            justify-self: flex-start;
        }
    }
}

/* ========================================
   BLOG UX ENHANCEMENTS (Added March 2026)
   ======================================== */

.blog-quick-summary {
    background: #f1f5ff;
    border-left: 4px solid #4f46e5;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.blog-quick-summary ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.blog-cta-box {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    padding: 1.3rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
}

.blog-cta-box a {
    display: inline-block;
    margin-top: 0.7rem;
    background: #ffffff;
    color: #4f46e5;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.blog-cta-box a:hover {
    background: #e0e7ff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* Ensure scrolling on small screens */
}

.table-responsive th, 
.table-responsive td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-responsive th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.blog-content {
    line-height: 1.85;
    font-size: 1rem;
}

.blog-content h2 {
    margin-top: 2.5rem;
}
