/* Image to PDF Tool Styles */
.text-gradient-teal { background: var(--grad-teal); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.tool-container { max-width: 1200px; margin: 0 auto; padding: calc(var(--nav-height) + 2rem) 2rem 4rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); text-decoration: none; font-size: 0.95rem; font-weight: 500; margin-bottom: 1.5rem; transition: var(--transition-smooth); }
.back-link:hover { color: var(--accent-teal); transform: translateX(-4px); }
.back-link svg { width: 18px; height: 18px; fill: currentColor; transform: rotate(180deg); }
.tool-header { margin-bottom: 2rem; }
.tool-main-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.tool-subtitle { color: var(--text-secondary); font-size: 1rem; }
.tool-grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
@media (max-width: 992px) { .tool-grid-layout { grid-template-columns: 1fr; } }

.tool-panel {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg); padding: 2rem;
    backdrop-filter: blur(20px); display: flex; flex-direction: column;
    gap: 1.5rem; position: relative; overflow: hidden;
}
.tool-panel::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(135deg, #6366f1, #8b5cf6); opacity: 0.7; }
.panel-header { border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem; }
.panel-title { font-family: 'Be Vietnam Pro', sans-serif; font-size: 1.2rem; font-weight: 700; color: white; display: flex; align-items: center; gap: 0.5rem; }

.dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.35); border-radius: var(--border-radius-md);
    background: rgba(15,23,42,0.3); padding: 2.5rem 1.5rem;
    text-align: center; cursor: pointer; transition: var(--transition-smooth);
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.dropzone:hover, .dropzone.dragover { border-color: #6366f1; background: rgba(99,102,241,0.05); box-shadow: 0 0 20px rgba(99,102,241,0.1); }
.dropzone-icon { width: 44px; height: 44px; color: #6366f1; opacity: 0.8; transition: var(--transition-smooth); }
.dropzone:hover .dropzone-icon { transform: translateY(-4px); opacity: 1; }
.dropzone-title { font-size: 1rem; font-weight: 600; color: white; }

.settings-group { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--border-radius-sm); padding: 1.25rem; }
.form-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; margin-bottom: 0.35rem; display: block; }
.form-select {
    width: 100%; background: rgba(15,23,42,0.6); border: 1px solid rgba(255,255,255,0.1);
    color: white; font-family: 'Inter', sans-serif; font-weight: 500;
    padding: 0.6rem 2rem 0.6rem 0.8rem; border-radius: 4px; outline: none; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='white'><path d='M7 10l5 5 5-5H7z'/></svg>");
    background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 18px;
    transition: var(--transition-smooth);
}
.form-select:focus { border-color: #6366f1; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; border-radius: var(--border-radius-sm); font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: var(--transition-smooth); border: none; gap: 0.5rem; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; box-shadow: 0 4px 20px rgba(99,102,241,0.3); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary { background: rgba(255,255,255,0.04); border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* Sortable thumbnail grid */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.75rem; }
.thumb-item {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px; overflow: hidden; display: flex; flex-direction: column;
    cursor: grab; transition: var(--transition-smooth); position: relative;
}
.thumb-item:active { cursor: grabbing; }
.thumb-item.drag-over { border-color: #6366f1; box-shadow: 0 0 12px rgba(99,102,241,0.3); }
.thumb-item img { width: 100%; aspect-ratio: 1; object-fit: cover; pointer-events: none; }
.thumb-item-label { font-size: 0.65rem; color: var(--text-secondary); padding: 0.25rem 0.4rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-page-num { position: absolute; top: 4px; left: 4px; background: rgba(99,102,241,0.85); color: white; font-size: 0.65rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.thumb-del-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); border: none; color: white; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; transition: var(--transition-smooth); }
.thumb-del-btn:hover { background: rgba(236,72,153,0.8); }

/* Right panel result */
.preview-container { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }
.pdf-success-badge {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    padding: 2rem; background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    border: 1px solid rgba(99,102,241,0.25); border-radius: var(--border-radius-md); width: 100%; text-align: center;
}
.pdf-icon-large { color: #6366f1; opacity: 0.9; }
.pdf-ready-title { font-size: 1.25rem; font-weight: 700; color: white; }
.pdf-ready-desc { font-size: 0.85rem; color: var(--text-secondary); }
#no-pdf { color: var(--text-secondary); text-align: center; padding: 3rem 1rem; }

/* Progress bar */
.progress-bar-wrapper { width: 100%; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; height: 6px; }
.progress-bar-fill { height: 100%; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-radius: 6px; transition: width 0.3s ease; width: 0%; }

/* Mobile */
.mobile-tabs-container { display: none; background: rgba(15,23,42,0.5); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--border-radius-md); padding: 0.35rem; margin-bottom: 1.5rem; gap: 0.35rem; }
.mobile-tab-btn { flex: 1; background: transparent; border: none; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; padding: 0.6rem; border-radius: 4px; cursor: pointer; transition: var(--transition-smooth); }
.mobile-tab-btn.active { background: rgba(99,102,241,0.12); color: white; }
@media (max-width: 992px) { .mobile-tabs-container { display: flex; } .tool-panel { display: none; } .active-panel { display: flex !important; } .tool-container { padding-left: 1rem; padding-right: 1rem; } .tool-panel { padding: 1.25rem; } }
