/* ============================================
   RESET & BASE STYLES
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --border-radius: 16px;
    --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8fafc;
    color: #0c2446;
    line-height: 1.6;
}

/* ============================================
   CONTAINER & LAYOUT
============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* ============================================
   HEADER
============================================ */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: var(--gray-light);
    color: var(--primary);
}

/* ============================================
   MAIN CONTENT - TEXT COLORS FIXED
============================================ */
.main-content {
    padding: 32px 0;
    min-height: calc(100vh - 180px);
}

.hero-section {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    line-height: 1.2;
    padding: 0 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgb(107 107 107 / 90%);
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.6;
    padding: 0 16px;
}

/* ============================================
   CONVERTER CARD
============================================ */
.converter-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--box-shadow);
    margin-bottom: 48px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.card-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h2 i {
    color: var(--primary);
    font-size: 2rem;
}

.card-subtitle {
    color: var(--gray);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================
   UPLOAD SECTION - FIXED CLICKABLE AREA
============================================ */
.upload-section {
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: var(--border-radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light);
    position: relative;
    margin-bottom: 20px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

.upload-area.dragover {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: 20px;
    opacity: 0.8;
}

.upload-area h3 {
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 600;
    pointer-events: none; /* Prevents interfering with click */
}

.upload-text {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 20px;
    pointer-events: none; /* Prevents interfering with click */
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10; /* Ensure it's on top */
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    min-height: 48px;
    position: relative;
    z-index: 20; /* Above the file input */
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.upload-button:active {
    transform: translateY(0);
}

.file-info {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 12px;
    pointer-events: none; /* Prevents interfering with click */
}

/* ============================================
   SYSTEM STATUS MESSAGE - FIXED COLORS
============================================ */
.info-message {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin: 20px auto;
    border-left: 4px solid var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-message i {
    color: #6766d8;
    font-size: 1.2rem;
}

.info-message strong {
    font-weight: 600;
    margin-right: 4px;
}

/* ============================================
   FILE LIST
============================================ */
.file-list {
    margin-top: 16px;
    width: 100%;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--gray-light);
    transition: var(--transition);
    gap: 12px;
}

.file-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 28px;
    color: var(--danger);
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-details h4 {
    color: var(--dark);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-word;
    max-width: 100%;
}

.file-name-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.file-details p {
    color: var(--gray);
    font-size: 0.875rem;
}

.remove-file {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   OPTIONS SECTION
============================================ */
.options-section {
    margin: 32px 0;
    padding: 32px;
    background: var(--light);
    border-radius: var(--border-radius);
    /*display: none;*/
}

.options-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.options-header i {
    color: var(--primary);
    font-size: 24px;
}

.options-header h3 {
    font-size: 1.375rem;
    color: var(--dark);
    font-weight: 600;
}

.option-group {
    margin-bottom: 24px;
}

.option-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.format-option {
    background: white;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.format-option:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.format-option.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.format-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 22px;
}

.format-option span {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    font-size: 1rem;
}

.format-option small {
    color: var(--gray);
    font-size: 0.8125rem;
}

/* Quality Slider */
.quality-slider {
    max-width: 500px;
    padding: 16px 0;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-light);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 12px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.875rem;
}

.quality-value {
    font-weight: 600;
    color: var(--primary);
}

/* Page Options */
.page-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
}

.radio-option:hover {
    background: white;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
}

.radio-option span {
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.page-range-input {
    padding: 10px 12px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    width: 180px;
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-range-input:focus {
    outline: none;
    border-color: var(--primary);
}

.page-range-input:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* DPI Settings */
.dpi-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dpi-btn {
    padding: 10px 20px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    color: var(--dark);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.dpi-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.dpi-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.dpi-input {
    width: 100px;
    padding: 10px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    transition: var(--transition);
}

.dpi-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   ACTION BUTTONS
============================================ */
.action-buttons {
    display: none;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--gray-light);
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #0da271);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
}

/* ============================================
   PROGRESS SECTION
============================================ */
.progress-section {
    display: none;
    text-align: center;
    padding: 32px;
    background: var(--light);
    border-radius: var(--border-radius);
    margin: 32px 0;
}

.progress-header {
    margin-bottom: 24px;
}

.progress-header h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-text {
    color: var(--gray);
    font-size: 1rem;
}

.progress-bar {
    height: 10px;
    background: var(--gray-light);
    border-radius: 5px;
    overflow: hidden;
    margin: 24px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 5px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   RESULTS SECTION
============================================ */
.results-section {
    display: none;
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 32px;
    margin: 32px 0;
}

.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.results-header h3 {
    font-size: 1.75rem;
    color: var(--success);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.results-text {
    color: var(--gray);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.preview-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.preview-img-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preview-item:hover .preview-img {
    transform: scale(1.05);
}

.page-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.preview-info {
    padding: 16px;
}

.file-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.file-size {
    font-size: 0.8125rem;
    color: var(--gray);
    background: var(--gray-light);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 8px;
}

.download-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.download-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
    transform: translateY(-2px);
}

.download-options {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--gray-light);
}

/* ============================================
   FEATURES SECTION
============================================ */
.features-section {
    margin: 48px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #494949;
    margin-bottom: 40px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: white;
    padding: 32px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
    font-size: 28px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--gray);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ============================================
   FOOTER
============================================ */
.footer {
    background: var(--dark);
    color: white;
    padding: 48px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ============================================
   UTILITY CLASSES
============================================ */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid var(--danger);
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.error-message.show {
    display: flex;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.info-message {
    background: rgb(156 166 228 / 27%);
    backdrop-filter: blur(10px);
    color: #646262;
    padding: 12px 20px;
    border-radius: 12px;
    margin: 20px auto;
    border-left: 4px solid var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.spin {
    animation: spin 1s linear infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.25rem;
    }
    
    .converter-card {
        padding: 24px;
    }
    
    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.95);
    }
    
    .converter-card {
        padding: 20px;
        margin-bottom: 32px;
    }
    
    .upload-area {
        padding: 32px 16px;
        min-height: 200px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .upload-area h3 {
        font-size: 1.1rem;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .options-section {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn {
        width: 100%;
        max-width: 100%;
        padding: 14px 20px;
    }
    
    .dpi-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dpi-btn, .dpi-input {
        width: 100%;
    }
    
    .dpi-input {
        width: 100%;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .download-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 24px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }
    
    .footer-links a {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.625rem;
    }
    
    .converter-card {
        padding: 16px;
    }
    
    .upload-area {
        padding: 24px 12px;
        min-height: 180px;
    }
    
    .upload-button {
        width: 100%;
        padding: 12px 16px;
    }
    
    .options-section {
        padding: 16px;
    }
    
    .format-option {
        padding: 16px 8px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .page-range-input {
        width: 100%;
        margin-top: 8px;
    }
    
    .radio-option {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn, .upload-button, .format-option, .dpi-btn, .radio-option, .download-btn, .nav-link {
        min-height: 52px;
        padding: 16px 20px;
    }
    
    .slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }
    
    .page-range-input {
        min-height: 52px;
        font-size: 16px;
    }
    
    .dpi-input {
        min-height: 52px;
        font-size: 16px;
    }
    
    /* Increase hit area for small buttons */
    .remove-file {
        padding: 12px;
        min-height: 48px;
        min-width: 48px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0044cc;
        --secondary: #6600cc;
        --success: #006600;
        --danger: #cc0000;
        --dark: #000000;
        --light: #ffffff;
        --gray: #666666;
        --gray-light: #e0e0e0;
    }
    
    .upload-area {
        border: 3px dashed var(--dark);
    }
    
    .format-option {
        border: 2px solid var(--dark);
    }
    
    .btn-outline {
        border: 2px solid var(--dark);
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure all content stays within viewport */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Text center utility */
.text-center {
    text-align: center;
}

/* Make sure upload area is always clickable */
.upload-area * {
    pointer-events: none;
}

.upload-area .file-input {
    pointer-events: all;
}

.upload-button {
    pointer-events: all;
}