/* PDF Merger Tool Styles */
.pdf-merger .container {
    max-width: 900px;
    width: 100%;
    margin: 30px auto;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,123,255,0.5);
    border-radius: 10px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    overflow: visible;
}
.pdf-merger h1 {
    font-size: 2em;
    color: #003f7f;
    margin-bottom: 30px;
    text-align: center;
}
#pdf-merger-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
}

#pdf-split-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
}

#file-inputs-wrapper {
    width: 100%;
}

/* PDF Split - Pages per file options card */
.split-options-card {
    width: 100%;
    margin-top: 20px;
    padding: 20px 24px;
    background: #f0f7ff;
    border: 1px solid #cce5ff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 63, 127, 0.06);
    text-align: center;
}

.split-options-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #003f7f;
    margin-bottom: 12px;
}

.split-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.split-preset-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #003f7f;
    background: white;
    border: 2px solid #b8d4f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.split-preset-btn:hover {
    background: #003f7f;
    color: white;
    border-color: #003f7f;
    transform: translateY(-1px);
}

.split-preset-btn.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
    transform: translateY(-1px);
}

.split-input-wrap {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.split-pages-input {
    width: 80px;
    height: 40px;
    padding: 0 12px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: #003f7f;
    background: white;
    border: 2px solid #b8d4f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.split-pages-input:focus {
    border-color: #003f7f;
    box-shadow: 0 0 0 3px rgba(0, 63, 127, 0.15);
}

.split-pages-input::-webkit-outer-spin-button,
.split-pages-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.split-pages-input[type="number"] {
    -moz-appearance: textfield;
}

.split-options-hint {
    margin: 10px 0 0 0;
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
}
#pdf-upload {
    width: 80%;
    padding: 10px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
}
#add-more-files {
    padding: 10px 20px;
    font-size: 18px;
    background: transparent;
    color: #007BFF;
    border: 1px solid #007BFF;
    border-radius: 12px;
    cursor: pointer;
    min-width: 160px;
    transition: transform 0.2s ease, background 0.2s ease;
}
#add-more-files:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.05);
}
/* Contenitore scelta file (uguale a File Analyzer) */
.pdf-merger .upload-area {
    width: 100%;
    text-align: center;
    padding: 48px 40px;
    border: 2px dashed #b8d4f0;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fcff 0%, #e8f4fd 50%, #f0f7fc 100%);
    box-sizing: border-box;
    box-shadow: inset 0 2px 8px rgba(0, 123, 255, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pdf-merger .upload-hint {
    margin: 16px 0 0 0;
    color: #666;
    font-size: 0.95rem;
}

.pdf-merger .upload-area:hover {
    border-color: #7eb8f0;
    box-shadow: inset 0 2px 12px rgba(0, 123, 255, 0.06);
}

.pdf-merger .file-input-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pdf-merger .file-input-wrapper input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.pdf-merger .choose-file-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    background: var(--btn-primary, #003f7f);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.pdf-merger .choose-file-btn:hover {
    background: #dc3545;
    transform: scale(1.03);
}

.pdf-file-input {
    display: block;
}
.file-preview {
    display: none;
    width: 100%;
    max-width: 450px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}
.file-preview-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}
#file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}
.file-name {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}
.reorder-buttons {
    display: flex;
    gap: 4px;
}
.btn-reorder {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #007BFF;
    background: white;
    color: #007BFF;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-reorder:hover:not(:disabled) {
    background: #0056b3;
    color: white;
}
.btn-reorder:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#submit-files {
    padding: 10px 20px;
    font-size: 18px;
    background: var(--btn-primary, #003f7f);
    color: white;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    min-width: 160px;
    width: auto;
    text-align: center;
    margin-top: 20px;
    transition: transform 0.2s ease, background 0.2s ease;
}
#submit-files:hover {
    background: #0056b3;
    transform: scale(1.05);
}
#pdf-result {
    font-size: 16px;
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #fafafa;
    display: none;
}
#result-message {
    color: #28a745;
    font-weight: bold;
}

@media (max-width: 768px) {
    .pdf-merger .container {
        margin: 20px 16px;
        padding: 28px 24px;
    }
}

@media (max-width: 600px) {
    .pdf-merger .container {
        margin: 12px 10px;
        padding: 24px 18px;
    }
    .pdf-merger h1 {
        font-size: 1.5em;
    }
    #pdf-upload {
        width: 100%;
    }
    #add-more-files,
    #submit-files {
        width: 100%;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .pdf-merger .container {
        margin: 8px 8px;
        padding: 20px 14px;
    }
}
