
/* ========================================
   LAZERTIMES - JPG TO PDF CONVERTER
======================================== */

[hidden] {
    display: none !important;
}

/* ========================================
   SELECTED IMAGES HEADER
======================================== */

.selected-images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 28px 0 20px;
}

.selected-images-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

#image-count {
    font-size: 13px;
    color: var(--muted);
}

.image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.danger-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.danger-btn:hover:not(:disabled) {
    background: #dc2626;
    color: #ffffff;
}

/* ========================================
   IMAGE THUMBNAIL GRID
======================================== */

.image-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.image-card {
    position: relative;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    transition: 0.2s ease;
}

.image-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.image-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.page-number {
    background: var(--hero-bg);
    color: var(--primary);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
}

.remove-image {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #ef4444;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.remove-image:hover:not(:disabled) {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

/* Image Preview */

.image-card img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: var(--background);
    border-radius: 10px;
}

.image-name {
    font-size: 12px;
    font-weight: 600;
    margin: 12px 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-size {
    font-size: 11px;
    color: var(--muted);
}

/* ========================================
   IMAGE REORDER BUTTONS
======================================== */

.image-order-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.order-btn {
    flex: 1;
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    font-size: 16px;
    cursor: pointer;
}

.order-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.order-btn:disabled,
.remove-image:disabled,
.danger-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.reorder-hint {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    margin: 16px 0 28px;
}

/* ========================================
   PDF SETTINGS
======================================== */

.compression-settings h2 {
    font-size: 22px;
    margin-bottom: 24px;
}

.pdf-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.pdf-input-group {
    min-width: 0;
}

.pdf-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pdf-input-group select,
.pdf-input-group input {
    width: 100%;
    box-sizing: border-box;
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px;
    font: inherit;
    font-size: 14px;
}

.pdf-input-group select {
    cursor: pointer;
}

.pdf-input-group select:focus,
.pdf-input-group input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.pdf-input-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   CUSTOM PDF FILENAME
======================================== */

.filename-group {
    margin-top: 24px;
}

.filename-input {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.filename-input input {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
}

.filename-input input:focus {
    outline-offset: -2px;
}

.filename-input span {
    padding: 13px 16px;
    color: var(--muted);
    font-size: 14px;
    border-left: 1px solid var(--border);
}

/* ========================================
   PDF SUMMARY
======================================== */

.pdf-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-top: 24px;
    gap: 12px;
}

.pdf-summary > div {
    text-align: center;
    min-width: 0;
}

.pdf-summary > div:not(:last-child) {
    border-right: 1px solid var(--border);
}

.pdf-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.pdf-summary strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* ========================================
   CONVERSION PROGRESS
======================================== */

#progress-section {
    margin-top: 24px;
}

.progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

#progress-value {
    color: var(--primary);
}

#conversion-progress {
    display: block;
    width: 100%;
    height: 10px;
    appearance: none;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: var(--border);
}

#conversion-progress::-webkit-progress-bar {
    background: var(--border);
    border-radius: 20px;
}

#conversion-progress::-webkit-progress-value {
    background: linear-gradient(
        90deg,
        #2563eb,
        #60a5fa
    );
    border-radius: 20px;
    transition: width 0.3s ease;
}

#conversion-progress::-moz-progress-bar {
    background: #2563eb;
    border-radius: 20px;
}

/* ========================================
   CONVERSION RESULT
======================================== */

#conversion-result {
    margin-top: 20px;
    padding: 16px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

[data-theme="dark"] #conversion-result {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
}

/* ========================================
   ACTION BUTTONS
======================================== */

.pdf-action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.pdf-action-buttons button {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

#download-btn:not(:disabled) {
    background: #16a34a;
}

#download-btn:hover:not(:disabled) {
    background: #15803d;
}

/* ========================================
   HOW TO USE SECTION
======================================== */

.tool-guide {
    margin-top: 48px;
}

.tool-guide > h2 {
    text-align: center;
    font-size: 26px;
    margin-bottom: 24px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.guide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.guide-card > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: var(--hero-bg);
    color: var(--primary);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.guide-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.guide-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* ========================================
   TABLET RESPONSIVE
======================================== */

@media (max-width: 850px) {

    .image-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */

@media (max-width: 600px) {

    .image-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .image-card img {
        height: 120px;
    }

    .selected-images-header {
        align-items: flex-start;
    }

    .image-actions {
        width: 100%;
    }

    .image-actions button {
        flex: 1;
        padding: 12px;
    }

    .pdf-settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pdf-summary {
        padding: 14px 8px;
        gap: 6px;
    }

    .pdf-summary span {
        font-size: 10px;
    }

    .pdf-summary strong {
        font-size: 17px;
    }

    .pdf-action-buttons {
        flex-direction: column;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .tool-guide > h2 {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .image-card:hover {
        transform: none;
    }

    #conversion-progress::-webkit-progress-value {
        transition: none;
    }
}
