/* ============================================
   PDFMend.in - Tool Pages Styles
   © Copyright 2026 PDFMend.in. All rights reserved.
   ============================================ */

.tool-page {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.tool-hero {
    padding: 48px 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.tool-hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: var(--primary-50);
    color: var(--primary);
}

.tool-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 12px;
}

.tool-hero p {
    font-size: 1.0625rem;
    max-width: 550px;
    margin: 0 auto;
}

.tool-workspace {
    padding: 48px 0 80px;
    max-width: 800px;
    margin: 0 auto;
}

/* File List */
.file-list {
    margin-top: 24px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.file-item:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.file-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.file-item-remove {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.file-item-remove:hover {
    background: var(--error);
    color: var(--white);
}

/* Drag sortable */
.file-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.file-item .drag-handle {
    cursor: grab;
    color: var(--gray-300);
    padding: 4px;
}

.file-item .drag-handle:active {
    cursor: grabbing;
}

/* Tool Options Panel */
.tool-options {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

.tool-options h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.option-group {
    margin-bottom: 16px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: block;
}

.option-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--white);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.option-btn:hover {
    border-color: var(--gray-300);
}

.option-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

/* Input Fields */
.tool-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition-fast);
}

.tool-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.tool-input::placeholder {
    color: var(--gray-400);
}

.tool-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.tool-range {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
}

.tool-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}

/* Process Button */
.process-btn-wrap {
    margin-top: 32px;
    text-align: center;
}

.process-btn {
    padding: 16px 48px;
    font-size: 1.0625rem;
    font-weight: 700;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.process-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,38,38,0.4);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Related Tools */
.related-tools {
    padding: 48px 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.related-tools h3 {
    text-align: center;
    margin-bottom: 32px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.related-tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.related-tool-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.related-tool-card span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* PDF Preview Thumbnails */
.pdf-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.pdf-thumb {
    position: relative;
    aspect-ratio: 210 / 297;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pdf-thumb:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.pdf-thumb.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.pdf-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-thumb-number {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.pdf-thumb-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.pdf-thumb.selected .pdf-thumb-check {
    display: flex;
}

/* Signature Canvas */
.signature-pad-container {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
}

.signature-pad-container canvas {
    width: 100%;
    height: 200px;
    cursor: crosshair;
}

.signature-pad-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--gray-200);
}

/* Watermark Preview */
.watermark-preview {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    aspect-ratio: 210 / 297;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: 16px;
}

.watermark-preview-text {
    position: absolute;
    color: rgba(220, 38, 38, 0.3);
    font-size: 2rem;
    font-weight: 700;
    transform: rotate(-45deg);
    white-space: nowrap;
    user-select: none;
}