/* =====================================================
   RESIZE PDF TOOL SPECIFIC STYLES (Complementary)
   ===================================================== */

/* Editor layout (two columns) */
.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .editor-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .preview-box {
        flex: 1.2;
        position: sticky;
        top: 20px;
    }
    .tool-settings {
        flex: 0.9;
    }
}

/* Preview box styling */
.preview-box {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border, #e5e7eb);
    overflow: hidden;
    box-shadow: var(--card-shadow, 0 4px 6px rgba(0,0,0,0.05));
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.preview-toolbar button {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: #1f2937;
}

.preview-toolbar button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.preview-toolbar input {
    width: 60px;
    text-align: center;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.preview-canvas-wrap {
    background: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 400px;
    max-height: 70vh;
    overflow: auto;
}

.preview-canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
    border-radius: 4px;
}

/* Tool settings panel (right side) */
.tool-settings {
    margin-top: 0;
}

.tool-settings.hidden {
    display: none;
}

/* Options grid inside settings */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* File box inside tool-settings */
.file-box {
    margin-bottom: 24px;
    background: var(--bg-light, #f9fafb);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border, #e5e7eb);
}

.file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
    flex: 2;
}

.file-pages,
.file-size {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Form controls inside options-grid */
.option-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #374151;
}

.form-control,
.option-group select,
.option-group input[type="number"],
.option-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: 0.2s;
}

.form-control:focus,
.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--primary, #00008B);
    box-shadow: 0 0 0 2px rgba(0, 0, 139, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
}

/* Action buttons inside tool-settings */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary, #00008B);
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success, #10b981);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Progress & messages inside tool-settings */
.progress-container {
    margin-top: 20px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary, #00008B);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 13px;
    color: #4b5563;
    text-align: center;
    margin-top: 8px;
}

.success-message {
    margin-top: 16px;
    padding: 10px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-message {
    margin-top: 16px;
    padding: 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    text-align: center;
}

/* Drag-over effect for upload-area */
.upload-area.drag-over {
    border-color: var(--primary, #00008B) !important;
    background-color: rgba(0, 0, 139, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 139, 0.2);
}

/* Responsive fine-tuning */
@media (max-width: 768px) {
    .preview-toolbar {
        gap: 8px;
    }
    .tool-settings {
        padding: 16px;
    }
    .file-row {
        flex-direction: column;
        align-items: flex-start;
    }
}