/* ==========================================================================
   PDF Combiner & Page Reorder Tool Stylesheet
   Matches existing premium Dark-Teal gradient styling
   ========================================================================== */

.jq-pdf-container {
    background: linear-gradient(135deg, #1a1a24 0%, #4d5667 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #fff;
    box-sizing: border-box;
}

.jq-pdf-container * {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Top / Header Section
   -------------------------------------------------------------------------- */
.jq-pdf-header-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.jq-pdf-title {
    font-size: 32px !important;
    font-weight: 500 !important;
    margin: 0 0 16px 0 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px;
}

.jq-pdf-intro {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.6 !important;
}

.jq-pdf-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jq-pdf-features li {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
}

.jq-pdf-features svg {
    flex-shrink: 0;
    margin-right: 12px;
}

/* --------------------------------------------------------------------------
   Upload / Dropzone Area
   -------------------------------------------------------------------------- */
.jq-pdf-dropzone {
    background: #1a1a24;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.1s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.jq-pdf-dropzone:hover {
    border-color: #b2ffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.jq-pdf-dropzone.dragover {
    border-color: #b2ffff;
    background-color: rgba(178, 255, 255, 0.08);
    transform: scale(1.005);
}

.jq-pdf-hidden-input {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.jq-pdf-upload-icon {
    color: #b2ffff;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}

.jq-pdf-dropzone:hover .jq-pdf-upload-icon {
    transform: translateY(-4px);
}

.jq-pdf-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.jq-pdf-highlight {
    color: #b2ffff;
    text-decoration: underline;
    font-weight: 600;
}

.jq-pdf-upload-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 12px 0;
}

.jq-pdf-privacy-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    display: block;
}

/* --------------------------------------------------------------------------
   Message Banners
   -------------------------------------------------------------------------- */
.jq-pdf-message-wrapper {
    margin-top: 16px;
}

.jq-pdf-message {
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    animation: jqPdfFadeIn 0.2s ease-out;
}

@keyframes jqPdfFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.jq-pdf-message--error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.jq-pdf-message--success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.jq-pdf-message--warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --------------------------------------------------------------------------
   File Summary Block
   -------------------------------------------------------------------------- */
.jq-pdf-summary-block {
    background: #1a1a24;
    padding: 24px;
    border-radius: 12px;
}

.jq-pdf-section-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 16px 0 !important;
    color: #b2ffff !important;
    letter-spacing: 0.5px;
}

.jq-pdf-uploaded-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jq-pdf-uploaded-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.jq-pdf-uploaded-list li .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jq-pdf-uploaded-list li .file-name {
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jq-pdf-uploaded-list li .file-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.jq-pdf-uploaded-list li .file-remove-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.jq-pdf-uploaded-list li .file-remove-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* --------------------------------------------------------------------------
   Async Page Rendering Progress & Status
   -------------------------------------------------------------------------- */
.jq-pdf-loader-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(26, 26, 36, 0.8);
    border-radius: 12px;
    padding: 20px;
}

.jq-pdf-loader-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.jq-pdf-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(178, 255, 255, 0.2);
    border-top-color: #b2ffff;
    border-radius: 50%;
    animation: jqPdfSpin 0.8s linear infinite;
}

@keyframes jqPdfSpin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Pages Reorder Block
   -------------------------------------------------------------------------- */
.jq-pdf-pages-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.jq-pdf-pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.jq-pdf-pages-header .jq-pdf-section-title {
    margin: 0 !important;
}

.jq-pdf-sort-controls {
    display: flex;
    gap: 8px;
}

.jq-pdf-small-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.jq-pdf-small-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   Draggable Pages Grid & Cards
   -------------------------------------------------------------------------- */
.jq-pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
}

.jq-pdf-card {
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.jq-pdf-card:hover {
    border-color: rgba(178, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Dragging visual adjustments */
.jq-pdf-card.sortable-ghost {
    opacity: 0.3;
    border-color: #b2ffff;
    background: rgba(178, 255, 255, 0.05);
}

.jq-pdf-card.sortable-chosen {
    border-color: #b2ffff;
    box-shadow: 0 8px 24px rgba(178, 255, 255, 0.15);
}

/* Drag Handle */
.jq-pdf-drag-handle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.15s, color 0.15s;
}

.jq-pdf-drag-handle:active {
    cursor: grabbing;
}

.jq-pdf-drag-handle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #b2ffff;
}

.jq-pdf-drag-handle::before {
    content: ":::";
    font-weight: bold;
    letter-spacing: 1px;
}

/* Thumbnail Container */
.jq-pdf-thumb-wrapper {
    background: #111116;
    border-radius: 6px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.jq-pdf-thumb-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Metadata block */
.jq-pdf-card-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jq-pdf-card-info .info-row {
    display: flex;
    justify-content: space-between;
    overflow: hidden;
}

.jq-pdf-card-info .info-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
}

.jq-pdf-card-info .info-value {
    font-weight: 600;
    color: #fff;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100px;
}

.jq-pdf-card-info .info-value--order {
    color: #b2ffff;
}

/* Controls Area (Move & Remove) */
.jq-pdf-card-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

/* Move to position input box */
.jq-pdf-move-group {
    display: flex;
    gap: 4px;
    width: 100%;
}

.jq-pdf-move-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff !important;
    font-size: 11px;
    padding: 4px 6px;
    width: 100%;
    outline: none;
    text-align: center;
    transition: border-color 0.15s;
    height: 26px;
    -moz-appearance: textfield;
}

.jq-pdf-move-input::-webkit-outer-spin-button,
.jq-pdf-move-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.jq-pdf-move-input:focus {
    border-color: #b2ffff;
}

.jq-pdf-move-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    height: 26px;
}

.jq-pdf-move-btn:hover {
    background: #b2ffff;
    color: #1a1a24;
}

/* Delete Card Button */
.jq-pdf-remove-btn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px;
    width: 100%;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    text-align: center;
}

.jq-pdf-remove-btn:hover {
    background-color: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* --------------------------------------------------------------------------
   Global Controls / Action Buttons Bar
   -------------------------------------------------------------------------- */
.jq-pdf-global-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.jq-pdf-actions-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.jq-pdf-actions-right {
    display: flex;
    align-items: center;
}

/* Button style foundations */
.jq-pdf-btn {
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    letter-spacing: 0.3px;
}

.jq-pdf-btn:active {
    transform: translateY(1px);
}

.jq-btn-icon {
    flex-shrink: 0;
}

.jq-pdf-btn--secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.jq-pdf-btn--secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.jq-pdf-btn--download {
    background-color: #b2ffff;
    color: #1a1a24;
    box-shadow: 0 4px 12px rgba(178, 255, 255, 0.2);
}

.jq-pdf-btn--download:hover {
    background-color: #e0ffff;
    box-shadow: 0 6px 20px rgba(178, 255, 255, 0.3);
}

.jq-pdf-btn--download:disabled {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.jq-pdf-btn--reset {
    background-color: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.jq-pdf-btn--reset:hover {
    background-color: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* --------------------------------------------------------------------------
   Responsive Layout Rules
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .jq-pdf-container {
        padding: 30px 24px;
        gap: 30px;
    }
    
    .jq-pdf-title {
        font-size: 28px !important;
    }
}

@media (max-width: 768px) {
    .jq-pdf-global-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .jq-pdf-actions-left {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .jq-pdf-actions-right {
        justify-content: stretch;
    }
    
    .jq-pdf-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .jq-pdf-pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .jq-pdf-card {
        padding: 8px;
    }
    
    .jq-pdf-thumb-wrapper {
        height: 120px;
    }
}
