/* --- JPG to PDF Converter Tool Isolated Styles (No Conflicts) --- */
:root {
    --jpg-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --jpg-card-bg: rgba(255, 255, 255, 0.90);
    --jpg-text-main: #0f172a;
    --jpg-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(--jpg-text-main); 
    display: flex;
    flex-direction: column;
    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;
}

.jpg-app-header, .jpg-main-content, .jpg-app-footer, #jpgLoadingOverlay {
    position: relative;
    z-index: 1;
}

/* Professional Gradient Header Bar */
.jpg-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;
}
.jpg-app-header .jpg-brand-title {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

/* Main Content wrapper */
.jpg-main-content {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Ultra-Premium Frosted Glass Container */
.jpg-converter-card {
    width: 100%;
    max-width: 750px;
    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);
}

/* Option Cards for Orientation */
.jpg-option-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}
.jpg-option-card:hover {
    border-color: #6366f1;
    background: #f8fafc;
}
.jpg-option-card input[type="radio"] {
    accent-color: #6366f1;
}
.jpg-option-card.jpg-active-card {
    border-color: #6366f1;
    background: #e0e7ff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

/* Sortable Grid for Images Preview */
#jpgImagePreviewGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}
.jpg-preview-thumb-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.jpg-preview-thumb-card:active {
    cursor: grabbing;
}
.jpg-preview-thumb-card:hover {
    border-color: #6366f1;
    box-shadow: 0 6px 15px rgba(99,102,241,0.15);
}
.jpg-thumb-img-wrapper {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.jpg-preview-thumb-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.jpg-thumb-delete-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    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;
}
.jpg-thumb-delete-badge:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Fullscreen Processing Overlay */
#jpgLoadingOverlay {
    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;
}
.jpg-spinner-ring {
    width: 60px; height: 60px;
    border: 5px solid rgba(255,255,255,0.2);
    border-top: 5px solid #38bdf8;
    border-radius: 50%;
    animation: jpg-spin 0.8s linear infinite;
    margin-bottom: 15px;
}
@keyframes jpg-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;
}