/* ============================================
   Image to PDF — css/style.css
   Author : gorupa (https://github.com/gorupa)
   License: MIT
   ============================================ */

/* ── Variables ── */
:root {
    --primary:       #e8410a;
    --primary-hover: #c73508;
    --primary-light: #fff0eb;
    --surface:       #ffffff;
    --background:    #faf8f6;
    --text-main:     #1c1a18;
    --text-muted:    #6b6560;
    --border:        #e5ddd6;
    --success:       #1e8e3e;
    --success-light: #e6f4ea;
    --shadow-lg:     0 12px 40px rgba(0,0,0,0.09), 0 4px 16px rgba(0,0,0,0.05);
    --radius:        20px;
    --radius-sm:     12px;
}

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

/* ── Body ── */
body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -5%,  rgba(232, 65, 10, 0.11) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 90% 95%, rgba(232, 65, 10, 0.06) 0%, transparent 55%);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 32px 20px;
    gap: 20px;
}

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0   rgba(232,65,10,0.22); }
    70%  { box-shadow: 0 0 0 10px rgba(232,65,10,0); }
    100% { box-shadow: 0 0 0 0   rgba(232,65,10,0); }
}
@keyframes pop-in {
    0%   { opacity: 0; transform: scale(0.88); }
    65%  { transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes check-bounce {
    0%   { transform: scale(0) rotate(-10deg); }
    60%  { transform: scale(1.15) rotate(3deg); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1) rotate(0deg); }
}
@keyframes slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Badge Strip ── */
.badge-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 0.5s ease both;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 100px;
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    user-select: none;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.pill .material-icons-round { font-size: 13px; }
.pill-mit    { background: #fff8e1; color: #92400e; border-color: #fde68a; }
.pill-oss    { background: #ede9fe; color: #4c1d95; border-color: #c4b5fd; }
.pill-adfree { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.pill-local  { background: var(--primary-light); color: #7c1d06; border-color: #fca99d; }

/* ── Container ── */
.container {
    max-width: 600px;
    width: 100%;
    animation: fadeUp 0.5s ease 0.08s both;
}

/* ── Header ── */
.header { text-align: center; margin-bottom: 28px; }

.hero-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #fff0eb 0%, #ffd9cc 100%);
    border-radius: 22px;
    margin-bottom: 18px;
    animation: pulse-ring 3s ease-in-out infinite;
}
.hero-icon { font-size: 34px; color: var(--primary); }

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.6px;
    margin-bottom: 7px;
    background: linear-gradient(135deg, #1c1a18 0%, #4a3f38 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header p { color: var(--text-muted); font-size: 0.925rem; line-height: 1.5; }

/* ── Sibling tool link ── */
.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a73e8;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 100px;
    background: #e8f0fe;
    border: 1px solid #bfdbfe;
    transition: all 0.15s;
}
.tool-link:hover { background: #d2e3fc; transform: translateY(-1px); }
.tool-link .material-icons-round { font-size: 14px; }

/* ── Card ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.95);
    transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 16px 48px rgba(0,0,0,0.11), 0 4px 16px rgba(0,0,0,0.05); }

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px 36px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fdfcfb;
    position: relative;
    overflow: hidden;
}
.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.upload-zone:hover::before,
.upload-zone.drag-over::before { opacity: 1; }
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232,65,10,0.1);
}
.upload-zone .material-icons-round {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 14px;
    display: block;
    position: relative;
    transition: transform 0.3s ease;
}
.upload-zone:hover .material-icons-round { transform: translateY(-4px) scale(1.05); }
.upload-zone h3 { margin-bottom: 6px; font-weight: 600; font-size: 1.05rem; position: relative; }
.upload-zone p  { color: var(--text-muted); font-size: 0.85rem; position: relative; margin-bottom: 14px; }

.format-tags { display: flex; gap: 6px; justify-content: center; position: relative; }
.format-tag {
    background: var(--border);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.71rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
}

/* ── Image Queue ── */
.queue-panel { animation: fadeUp 0.3s ease both; }

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.queue-title {
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.queue-title .material-icons-round { font-size: 18px; color: var(--primary); }
.queue-count {
    background: var(--primary);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    font-family: 'DM Mono', monospace;
}

.add-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid #fca99d;
    border-radius: 100px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
    margin-left: auto;
}
.add-more-btn:hover { background: #ffd9cc; transform: translateY(-1px); }
.add-more-btn .material-icons-round { font-size: 14px; }

/* ── Image List ── */
.image-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 20px;
}
.image-list::-webkit-scrollbar { width: 4px; }
.image-list::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
.image-list::-webkit-scrollbar-thumb { background: #c4b5a0; border-radius: 4px; }

.image-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    animation: slide-in 0.25s ease both;
    transition: all 0.2s ease;
}
.image-item:hover { border-color: #fca99d; background: #fffaf8; }

.item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.item-info { flex: 1; min-width: 0; }
.item-name {
    font-weight: 600;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-size {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-top: 2px;
}
.item-drag-handle {
    color: var(--border);
    cursor: grab;
    font-size: 20px;
    flex-shrink: 0;
    transition: color 0.15s;
    user-select: none;
}
.image-item:hover .item-drag-handle { color: #c4b5a0; }

.item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.item-remove:hover { background: #ffe4e0; color: #c73508; }
.item-remove .material-icons-round { font-size: 18px; }

/* ── Options ── */
.options-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.option-group { flex: 1; min-width: 130px; }
.option-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.option-buttons { display: flex; gap: 6px; }
.opt-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.opt-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.opt-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Convert Button ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #c73508 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.975rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 4px 14px rgba(232,65,10,0.28);
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.btn:hover {
    box-shadow: 0 6px 22px rgba(232,65,10,0.38);
    transform: translateY(-1px);
}
.btn:active  { transform: scale(0.98) translateY(0); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ── Progress ── */
.progress-bar-wrap {
    background: var(--border);
    border-radius: 100px;
    height: 6px;
    margin-top: 16px;
    overflow: hidden;
    display: none;
}
.progress-bar-wrap.visible { display: block; }
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff7043);
    border-radius: 100px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    font-family: 'DM Mono', monospace;
    display: none;
}
.progress-label.visible { display: block; }

/* ── Results ── */
.results { animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.success-box { text-align: center; }

.success-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #fff0eb 0%, #ffd9cc 100%);
    border-radius: 50%;
    margin-bottom: 14px;
    box-shadow: 0 0 0 8px rgba(232,65,10,0.07);
}
.success-icon {
    font-size: 42px;
    color: var(--primary);
    animation: check-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-box h3   { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.success-box .sub { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }

.result-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.stat-box {
    flex: 1;
    background: var(--background);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: transform 0.2s ease;
}
.stat-box:hover { transform: translateY(-2px); }
.stat-box.highlight {
    background: linear-gradient(135deg, #fff0eb 0%, #ffe4d8 100%);
    border-color: #fca99d;
}
.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
}
.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--text-main);
}
.stat-box.highlight .stat-value { color: var(--primary); }

/* ── Download Button ── */
.download-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #c73508 100%);
    box-shadow: 0 4px 14px rgba(232,65,10,0.28);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.975rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
}
.download-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.download-btn:hover {
    box-shadow: 0 6px 22px rgba(232,65,10,0.38);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
    padding: 8px;
    text-decoration: underline;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    transition: color 0.15s;
}
.btn-text:hover { color: var(--text-main); }

/* ── Footer ── */
.footer {
    text-align: center;
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.8;
    animation: fadeUp 0.5s ease 0.18s both;
}
.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.15s;
}
.footer a:hover { opacity: 0.75; text-decoration: underline; }
.footer .sep    { margin: 0 7px; opacity: 0.35; }
.github-icon    { width: 14px; height: 14px; fill: currentColor; vertical-align: middle; }

/* ── Utility ── */
.hidden { display: none !important; }
