/* --- PDF to JPG Converter & Results Separate Styles --- */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --card-bg: rgba(255, 255, 255, 0.90);
    --text-main: #0f172a;
    --text-muted: #64748b;
}

html, body {
    height: 100%;
    margin: 0;
}

body { 
    background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 50%, #e0f2fe 100%);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: var(--text-main); 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Glowing Orbs Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 5%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.18);
    filter: blur(100px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    top: 35%;
    right: 10%;
    width: 550px;
    height: 550px;
    background: rgba(6, 182, 212, 0.15);
    filter: blur(110px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.app-header, .main-content, .results-main-content, .app-footer, #loadingOverlay {
    position: relative;
    z-index: 1;
}

/* Professional Gradient Header Bar */
.app-header {
    background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #1e1b4b 100%);
    backdrop-filter: blur(16px);
    color: white;
    padding: 16px 35px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 3px solid #06b6d4;
    flex-shrink: 0;
}
.app-header .brand-title {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

/* Main Content wrappers */
.main-content {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.results-main-content {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

/* Ultra-Premium Frosted Glass Containers */
.converter-card {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
}

.results-box {
    width: 100%;
    max-width: 850px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
}

.quality-card { 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    padding: 15px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    background: #fff; 
}
.quality-card:hover { 
    border-color: #6366f1; 
    background: #f8fafc; 
}
.quality-card input[type="radio"] { 
    accent-color: #6366f1; 
}
.quality-card.active-card { 
    border-color: #6366f1; 
    background: #e0e7ff; 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12); 
}

/* Results page specific cards */
.page-item-card { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-wrap: nowrap;
    gap: 15px;
    transition: all 0.2s; 
}
.page-item-card:hover { 
    border-color: #6366f1; 
    background: #fff; 
    box-shadow: 0 4px 12px rgba(99,102,241,0.08); 
}

/* Thumbnail Wrapper with Absolute Delete Cross Badge */
.thumb-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.page-thumb { 
    width: 55px; 
    height: 70px; 
    object-fit: cover; 
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    background: #fff; 
    cursor: pointer; 
    transition: transform 0.2s;
}
.page-thumb:hover { 
    transform: scale(1.05); 
    border-color: #6366f1; 
}

/* Floating Delete Cross Icon on Top Right of Thumbnail */
.delete-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid #ffffff;
    z-index: 10;
}
.delete-badge:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Fullscreen Processing Overlay */
#loadingOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1040;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}
.spinner-ring {
    width: 60px; height: 60px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top: 5px solid #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Professional Clean Dark Footer (Fixed at bottom permanently) */
.app-footer {
    flex-shrink: 0;
    background: #0f172a;
    color: #94a3b8;
    padding: 25px 20px;
    text-align: center;
    font-size: 13.5px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    border-top: 3px solid #6366f1;
    width: 100%;
}
.app-footer b {
    color: #fde047;
    font-weight: 700;
    letter-spacing: 0.3px;
}