/* Doc Converter Specific Styles */

.doc-converter-container {
    max-width: 1200px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-16);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-500);
    background: var(--surface);
    transform: translateY(-2px);
}

.upload-area i {
    font-size: 64px;
    color: var(--primary-500);
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.upload-area:hover i {
    transform: scale(1.1);
}

.file-list {
    margin-top: var(--space-8);
    display: grid;
    gap: 12px;
}

.file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideIn 0.3s ease-out;
    width: 100%;
    min-width: 0;
}

.file-preview {
    width: 50px;
    height: 65px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Organize Grid */
.organize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.page-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    position: relative;
    cursor: grab;
    transition: all 0.2s;
}

.page-card:active { cursor: grabbing; }
.page-card:hover { border-color: var(--primary-500); transform: translateY(-4px); }

.page-thumb {
    width: 100%;
    aspect-ratio: 1/1.4;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-num {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--primary-500);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.page-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.page-card:hover .page-remove { opacity: 1; }

/* Signature Modal */
.sig-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.sig-content {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: 32px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-2xl);
}

.sig-canvas-wrapper {
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    background: white;
    margin: 20px 0;
    cursor: crosshair;
}

#signatureCanvas {
    width: 100%;
    height: 300px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-icon { font-size: 24px; color: var(--primary-500); flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; overflow: hidden; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; display: block; }
.file-meta { display: flex; gap: 12px; font-size: 11px; opacity: 0.6; }

.conversion-options {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-top: var(--space-8);
    display: none;
    box-shadow: var(--shadow-lg);
}

.option-group { margin-bottom: 24px; }
.option-group h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; opacity: 0.6; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.tool-card-item { 
    border: 1px solid var(--border); 
    border-radius: var(--radius-lg); 
    padding: 12px 8px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.2s; 
    background: var(--bg-secondary);
}
.tool-card-item:hover, .tool-card-item.active { 
    border-color: var(--primary-500); 
    background: var(--surface); 
    transform: translateY(-2px); 
}
.tool-card-item.active { background: var(--primary-50); border-color: var(--primary-500); }
.tool-card-item i { font-size: 18px; color: var(--primary-500); margin-bottom: 6px; display: block; }
.tool-card-item span { font-size: 11px; font-weight: 600; display: block; line-height: 1.2; }

.advanced-settings { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 20px; margin-top: 16px; display: none; }

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    display: none;
}

.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top: 4px solid var(--primary-500); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.chain-actions { display: flex; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); display: none; }

.advanced-settings input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
}
.advanced-settings input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
}

@media (max-width: 640px) {
    .upload-area { padding: var(--space-8); }
    .upload-area i { font-size: 48px; }
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .tool-card-item { padding: 10px 4px; }
    .tool-card-item i { font-size: 16px; }
    .tool-card-item span { font-size: 10px; }
    .file-preview { width: 40px; height: 55px; }
    .file-name { font-size: 12px; }
    .file-item { padding: 8px 12px; gap: 12px; }
}
