/* Image to PDF Tool v1 */

/* Ads */
.ip-ad { margin: var(--space-4) 0; text-align: center; overflow: hidden; }
.ip-ad__wrap { display: inline-block; max-width: 100%; overflow: hidden; }
.ip-ad--728 { display: block; } .ip-ad--300 { display: none; }
@media (max-width: 768px) { .ip-ad--728 { display: none; } .ip-ad--300 { display: block; } }
.ip-ad iframe { max-width: 100% !important; }
.ip-ad--processing, .ip-ad--result { text-align: center; margin-top: var(--space-4); }

/* Upload */
.ip-upload { position: relative; border: 2px dashed var(--gray-300); border-radius: var(--radius-xl); padding: var(--space-8) var(--space-4); text-align: center; cursor: pointer; background: var(--bg-secondary); transition: all 0.2s; }
.ip-upload:hover, .ip-upload.drag-over { border-color: var(--primary-400); background: var(--primary-50); }
.ip-upload__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ip-upload__icon { color: var(--text-tertiary); margin-bottom: var(--space-3); }
.ip-upload:hover .ip-upload__icon { color: var(--primary-500); }
.ip-upload__title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ip-upload__hint { font-size: 13px; color: var(--text-tertiary); }

/* Thumbnails section */
.ip-thumbs-section { background: var(--bg-secondary); border: 1px solid var(--gray-100); border-radius: var(--radius-xl); overflow: hidden; margin-bottom: var(--space-4); }
.ip-thumbs-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--gray-100); }
.ip-thumbs-header__count { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.ip-thumbs-header__count svg { flex-shrink: 0; }
.ip-thumbs-header__actions { display: flex; gap: 6px; }

/* Thumbnail grid */
.ip-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; padding: var(--space-3) var(--space-4); max-height: 360px; overflow-y: auto; }
.ip-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 2px solid var(--gray-200); cursor: grab; transition: all 0.15s; background: var(--bg-tertiary); }
.ip-thumb:hover { border-color: var(--primary-400); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.ip-thumb.dragging { opacity: 0.35; cursor: grabbing; transform: scale(0.95); }
.ip-thumb__img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ip-thumb__remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; }
.ip-thumb:hover .ip-thumb__remove { opacity: 1; }
.ip-thumb__remove:hover { background: var(--error, #ef4444); }
.ip-thumb__badge { position: absolute; bottom: 3px; left: 3px; background: rgba(0,0,0,0.65); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.ip-drag-hint { font-size: 11px; color: var(--text-tertiary); padding: 6px var(--space-4) var(--space-3); display: flex; align-items: center; gap: 6px; }
.ip-drag-hint svg { flex-shrink: 0; }

/* Settings */
.ip-settings { background: var(--bg-secondary); border: 1px solid var(--gray-100); border-radius: var(--radius-xl); padding: var(--space-4); margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.ip-setting { }
.ip-setting__label { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.ip-setting__label svg { flex-shrink: 0; }
.ip-setting__optional { font-weight: 400; color: var(--text-tertiary); text-transform: none; letter-spacing: 0; }

/* Pill buttons */
.ip-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.ip-pill { padding: 8px 14px; font-size: 12px; font-weight: 600; background: var(--bg-tertiary); border: 1.5px solid transparent; border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary); transition: all 0.15s; white-space: nowrap; }
.ip-pill:hover { background: var(--gray-100); color: var(--text-primary); }
.ip-pill.active { background: var(--primary-100); border-color: var(--primary-500); color: var(--primary-700); }

/* Custom size inputs */
.ip-custom-size { display: flex; align-items: center; gap: 8px; }
.ip-custom-size span { color: var(--text-tertiary); font-weight: 600; }
.ip-custom-input { width: 80px; padding: 8px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); font-size: 13px; font-weight: 600; text-align: center; background: var(--bg-primary); }
.ip-custom-input:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.ip-custom-select { padding: 8px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); font-size: 12px; font-weight: 600; background: var(--bg-primary); cursor: pointer; }

/* Target size */
.ip-target { display: flex; gap: 8px; }
.ip-target__field { flex: 1; display: flex; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; }
.ip-target__field:focus-within { border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.ip-target__input { flex: 1; border: none; padding: 9px 12px; font-size: 13px; font-weight: 600; text-align: center; background: var(--bg-primary); color: var(--text-primary); outline: none; min-width: 0; }
.ip-target__input::placeholder { font-weight: 400; color: var(--text-tertiary); }
.ip-target__unit { padding: 9px 12px; font-size: 11px; font-weight: 700; border: none; border-left: 1.5px solid var(--gray-200); background: var(--bg-tertiary); color: var(--text-secondary); }
.ip-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* Buttons */
.ip-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s; font-size: 14px; padding: 10px 18px; }
.ip-btn svg { flex-shrink: 0; }
.ip-btn--primary { background: var(--primary-600); color: #fff; }
.ip-btn--primary:hover:not(:disabled) { background: var(--primary-700); }
.ip-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.ip-btn--sm { font-size: 12px; padding: 6px 12px; }
.ip-btn--ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--gray-200); }
.ip-btn--ghost:hover { background: var(--bg-tertiary); }
.ip-btn--danger { color: var(--error, #ef4444); border-color: currentColor; }
.ip-btn--full { width: 100%; }
.ip-btn--lg { padding: 14px 24px; font-size: 15px; border-radius: var(--radius-lg); }

.ip-privacy { display: flex; align-items: center; gap: 8px; margin-top: var(--space-3); font-size: 12px; color: var(--text-tertiary); }
.ip-privacy svg { flex-shrink: 0; }

/* Overlay */
.ip-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-4); }
.ip-overlay.hidden { display: none; }
.ip-overlay__content { background: var(--bg-primary); border-radius: var(--radius-xl); padding: var(--space-6) var(--space-5); text-align: center; max-width: 360px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.ip-overlay__text { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ip-overlay__sub { font-size: 12px; color: var(--text-tertiary); }
.ip-spinner { width: 32px; height: 32px; border: 3px solid var(--gray-200); border-top-color: var(--primary-500); border-radius: 50%; animation: ip-spin 0.8s linear infinite; }
@keyframes ip-spin { to { transform: rotate(360deg); } }

/* Shared result styles */
.tc-breadcrumb { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: var(--space-4); }
.tc-breadcrumb a { color: var(--text-tertiary); text-decoration: none; } .tc-breadcrumb a:hover { color: var(--primary-600); }
.tc-breadcrumb span { margin: 0 var(--space-1); } .tc-breadcrumb span:last-child { color: var(--text-primary); font-weight: 500; }
.tc-header { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); }
.tc-header__icon { flex-shrink: 0; margin-top: 2px; color: var(--primary-600); }
.tc-header__title { font-size: var(--text-2xl); font-weight: 700; margin: 0 0 var(--space-1); }
.tc-header__desc { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; line-height: 1.5; }

.tc-result { max-width: 480px; margin: 0 auto; padding: var(--space-6); }
.tc-result__header { text-align: center; margin-bottom: var(--space-6); }
.tc-result__icon { margin-bottom: var(--space-2); color: var(--success); }
.tc-result__title { font-size: var(--text-xl); font-weight: 700; color: var(--success); margin: 0 0 var(--space-2); }
.tc-result__meta { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.tc-result__file { display: flex; align-items: center; gap: 12px; padding: var(--space-4); background: var(--bg-tertiary); border-radius: var(--radius-lg); margin-bottom: var(--space-4); border: 1px solid var(--gray-100); }
.tc-result__file-icon { flex-shrink: 0; color: var(--text-tertiary); }
.tc-result__filename { font-weight: 600; font-size: 14px; word-break: break-all; }
.tc-result__filesize { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tc-result__rename { margin-bottom: var(--space-4); }
.tc-result__rename label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.tc-result__rename input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); font-size: 14px; background: var(--bg-primary); box-sizing: border-box; }
.tc-result__rename input:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.tc-result__actions { display: flex; gap: 10px; margin-bottom: var(--space-4); }
.tc-result__actions .btn { flex: 1; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tc-result__actions .btn svg { flex-shrink: 0; }
.tc-related { padding-top: var(--space-4); border-top: 1px solid var(--gray-100); }
.tc-related__title { font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-3); }
.tc-related__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tc-related__grid a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; background: var(--bg-tertiary); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; border: 1px solid transparent; }
.tc-related__grid a svg { flex-shrink: 0; }
.tc-related__grid a:hover { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-200); }
.tc-faq { display: flex; flex-direction: column; gap: var(--space-3); }
.tc-faq details { background: var(--bg-secondary); border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: var(--space-4); }
.tc-faq details[open] { border-color: var(--primary-200); }
.tc-faq summary { font-weight: 500; cursor: pointer; font-size: var(--text-sm); }
.tc-faq p { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }

.hidden { display: none !important; }

@media (max-width: 600px) {
    .ip-upload { padding: var(--space-6) var(--space-3); }
    .ip-thumbs { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .ip-pills { gap: 4px; }
    .ip-pill { padding: 7px 10px; font-size: 11px; }
    .ip-custom-size { flex-wrap: wrap; }
    .ip-custom-input { width: 70px; }
    .tc-result { padding: var(--space-4); }
    .tc-related__grid { grid-template-columns: 1fr; }
}