.comp-pdf-hidden {
    display: none !important;
}

.comp-pdf-wrap {
    max-width: 600px;
    margin: 22px auto 40px;
    padding: 18px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    color: #222;
    box-sizing: border-box;
}

.comp-pdf-file-list-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 16px;
    padding: 12px;
    background-color: #fdfdfd;
}

.comp-pdf-file-list-header {
    font-weight: 500;
    margin-bottom: 0;
    color: #333;
    font-size: 17px;
}

#comp-pdf-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comp-pdf-title {
    font-size: 22px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 12px;
    color: #0b486b;
    margin-top: 0;
}

#comp-pdf-file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    color: #555;
}

#comp-pdf-file-list li:last-child {
    border-bottom: none;
}

.comp-pdf-remove-file-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: background-color 0.2s, color 0.2s, transform 0.1s ease;
}

.comp-pdf-remove-file-btn:hover,
.comp-pdf-remove-file-btn:focus {
    background-color: transparent;
    color: #e74c3c;
    /* Red color on hover for better affordance */
    outline: none;
}

.comp-pdf-remove-file-btn:active {
    transform: scale(0.95);
}

.comp-pdf-remove-file-btn svg {
    width: 18px;
    height: 18px;
}

.comp-pdf-selected-file-name {
    font-weight: 500;
    font-size: 17px;
}

.comp-pdf-selected-file-size {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.comp-pdf-file-icon {
    width: 35px;
    height: 35px;
    color: #d33;
    /* PDF red */
    flex-shrink: 0;
}

.comp-pdf-sub {
    font-size: 16px;
    color: #555;
    text-align: center;
    margin-bottom: 18px;
}

.comp-pdf-drop {
    border: 2px dashed #d6dde3;
    border-radius: 8px;
    padding: 35px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    transition: border-color .2s, background .2s;
}

.comp-pdf-drop.comp-pdf-dragover {
    border-color: #2b8cff;
    background: rgba(43, 140, 255, 0.03);
}

.comp-pdf-instructions {
    text-align: center;
}

.comp-pdf-instructions p {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 17px;
    text-align: center;
}

.comp-pdf-btn {
    background: #0070C6;
    /* Increased contrast */
    color: #fff;
    padding: 9px 12px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 6px 12px rgba(0, 92, 184, 0.12);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
    gap: 8px;
}

#comp-pdf-actions-wrapper {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.comp-pdf-wrap .comp-pdf-secondary-btn {
    background: #f0f0f0;
    color: #333;
    box-shadow: none;
    border: 1px solid #ddd;
}

.comp-pdf-wrap .comp-pdf-secondary-btn:hover,
.comp-pdf-wrap .comp-pdf-secondary-btn:focus,
.comp-pdf-wrap .comp-pdf-secondary-btn:active {
    background-color: #f0f0f0;
    color: #333;
    border-color: #ddd;
    /* Keep border color consistent */
    box-shadow: none;
}

.comp-pdf-wrap .comp-pdf-secondary-btn:active {
    transform: scale(0.98);
}

.comp-pdf-btn:disabled {
    opacity: .6;
    cursor: default;
    box-shadow: none;
}

.comp-pdf-btn:hover,
.comp-pdf-btn:focus,
.comp-pdf-btn:focus {
    background: #0070C6;
    color: #fff;
    box-shadow: 0 6px 12px rgba(0, 92, 184, 0.12);
    outline: none;
    text-decoration: none;
}

.comp-pdf-btn:active {
    transform: scale(0.98);
}

.comp-pdf-controls {
    margin-top: 16px;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.comp-pdf-control {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
}

.comp-pdf-range {
    width: 180px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.comp-pdf-meta {
    color: #555;
    word-break: break-word;
    text-align: center;
}

.comp-pdf-progress-wrapper {
    display: flex;
    align-items: center;
    margin-top: 16px;
    gap: 10px;
}

.comp-pdf-progress {
    background: #f3f6f8;
    border-radius: 10px;
    overflow: hidden;
    height: 16px;
    flex-grow: 1;
}

.comp-pdf-progress-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
    text-align: right;
    line-height: 16px;
}

.comp-pdf-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2b8cff, #17a2ff);
    transition: width .25s;
}

.comp-pdf-result {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#comp-pdf-result-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comp-pdf-result-list {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comp-pdf-result-item {
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comp-pdf-result-item-name {
    word-break: break-all;
    font-weight: 500;
    font-size: 17px;
}

.comp-pdf-result-item-details {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 14px;
    gap: 6px;
}

.comp-pdf-result-item-savings {
    color: #0F662F;
    font-weight: 500;
}

.comp-pdf-result-item-download {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background-color 0.2s, color 0.2s, transform 0.1s ease;
}

.comp-pdf-result-item-download:hover,
.comp-pdf-result-item-download:focus {
    background: transparent;
    color: #555;
}

.comp-pdf-result-item-download:active {
    transform: scale(0.95);
}

.comp-pdf-result-item-download svg {
    width: 20px;
    height: 20px;
}


.comp-pdf-result-icon {
    font-size: 28px;
    color: #d33;
    /* PDF red */
    flex-shrink: 0;
}

.comp-pdf-download {
    background: #0F662F;
    /* Increased contrast */
    color: #fff;
    padding: 9px 12px;
    border-radius: 8px;
    border: 0;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
    gap: 8px;
}

.comp-pdf-download:hover,
.comp-pdf-download:focus,
.comp-pdf-download:focus {
    background: #0F662F;
    color: #fff;
    outline: none;
    text-decoration: none;
}

.comp-pdf-download:active {
    transform: scale(0.98);
}

.comp-pdf-download:disabled {
    opacity: .6;
    cursor: default;
}

.comp-pdf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: comp-pdf-spin 1s linear infinite;
    /* CLS Fix: Use visibility to reserve space */
    transition: visibility 0s, opacity 0.2s linear;
}

.comp-pdf-spinner.comp-pdf-hidden {
    visibility: hidden;
    opacity: 0;
}

.comp-pdf-drop-spinner-wrapper {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-direction: column;
    gap: 10px;
}

.comp-pdf-drop-spinner {
    border-top-color: #0070C6;
    width: 30px;
    height: 30px;
}

@keyframes comp-pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.comp-pdf-small {
    color: #666;
}

.comp-pdf-animated-text {
    text-align: center;
    margin: 20px 0 10px 0;
    font-size: 16px;
    color: #555;
    height: 18px;
    /* Reserve space to prevent layout shift */
}

.comp-pdf-progress-spinner {
    border: 3px solid #f0f0f0;
    border-top-color: #3498db;
    width: 20px;
    height: 20px;
}

/* Unified styling for input and select boxes */
.comp-pdf-control select,
.comp-pdf-control input[type="number"] {
    padding: 10px 12px;
    font-size: 15px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Active/Focus state with a light border */
.comp-pdf-control select:active,
.comp-pdf-control input[type="number"]:active,
.comp-pdf-control select:focus,
.comp-pdf-control input[type="number"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 1px rgba(0, 92, 184, 0.2);
    background-color: white;
}

/* Custom arrow for all select elements in controls */
.comp-pdf-control select {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Remove number input spinners and set width */
.comp-pdf-control input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    width: 80px;
}

.comp-pdf-control input[type="number"]::-webkit-inner-spin-button,
.comp-pdf-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.faq-list {
    margin-top: 1rem;
}

.faq-list dt {
    font-weight: 500;
    font-size: 1.1em;
}

.faq-list dd {
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

/* responsive */
@media (max-width:720px) {
    .comp-pdf-wrap {
        padding: 18px 0;
        box-shadow: none;
        border-radius: 0;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
    }

    .comp-pdf-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .comp-pdf-control {
        padding: 8px 0;
    }

    .comp-pdf-meta {
        line-height: 1.2;
    }

    .comp-pdf-file-list-wrapper {
        border: none;
        padding: 10px 0;
        background-color: transparent;
    }

    #comp-pdf-result-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .comp-pdf-btn {
        padding: 8px;
    }

    .comp-pdf-result-item {
        padding: 8px 0 8px 3px;
    }

    .comp-pdf-range {
        gap: 4px;
    }

}