/**
 * ConvMaster - Images to PDF Converter Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tool-header__icon .icon--red {
    background: rgba(239, 68, 68, 0.15);
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   IMAGE TO PDF WIDGET
   ===================================================== */
.imagetopdf {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Drop Zone */
.imagetopdf__dropzone {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.imagetopdf__dropzone:hover {
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.05);
}

.imagetopdf__dropzone--active {
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
    transform: scale(1.01);
}

.imagetopdf__dropzone[hidden] {
    display: none !important;
}

.imagetopdf__dropzone-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.imagetopdf__dropzone-icon svg {
    width: 100%;
    height: 100%;
}

.imagetopdf__dropzone-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.imagetopdf__dropzone-hint {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

.imagetopdf__dropzone-formats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.imagetopdf__arrow {
    color: var(--text-muted);
    font-weight: bold;
    padding: 0 0.5rem;
}

/* Format Badges */
.format-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 4px;
    text-transform: uppercase;
}

.format-badge--pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.format-badge--png {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.format-badge--jpg,
.format-badge--jpeg {
    background: rgba(249, 115, 22, 0.15);
    color: #F97316;
}

.format-badge--webp {
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
}

.format-badge--gif {
    background: rgba(236, 72, 153, 0.15);
    color: #EC4899;
}

.format-badge--svg {
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
}

/* =====================================================
   WORKSPACE
   ===================================================== */
.imagetopdf__workspace {
    padding: 1.5rem;
}

.imagetopdf__workspace[hidden] {
    display: none !important;
}

/* =====================================================
   IMAGES SECTION
   ===================================================== */
.imagetopdf__images-section {
    margin-bottom: 1.5rem;
}

.imagetopdf__images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.imagetopdf__images-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.imagetopdf__images-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.imagetopdf__images-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.imagetopdf__images-hint svg {
    opacity: 0.6;
}

/* Images Grid */
.imagetopdf__images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

/* Image Thumbnail */
.imagetopdf__image {
    position: relative;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: grab;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}

.imagetopdf__image:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.imagetopdf__image.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
}

.imagetopdf__image.sortable-drag {
    cursor: grabbing;
}

.imagetopdf__image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.imagetopdf__image-number {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.imagetopdf__image-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 1rem;
    line-height: 1;
}

.imagetopdf__image:hover .imagetopdf__image-remove {
    opacity: 1;
}

.imagetopdf__image-remove:hover {
    background: #DC2626;
}

.imagetopdf__image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =====================================================
   OPTIONS
   ===================================================== */
.imagetopdf__options {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.imagetopdf__options-title {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.imagetopdf__options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.imagetopdf__option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.imagetopdf__option--full {
    grid-column: 1 / -1;
}

.imagetopdf__option[hidden] {
    display: none !important;
}

.imagetopdf__option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.imagetopdf__option-value {
    font-weight: 500;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

/* Select Dropdown */
.imagetopdf__select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.imagetopdf__select:hover,
.imagetopdf__select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Light theme specifics */
[data-theme="light"] .imagetopdf__select {
    background-color: white;
}

/* Slider */
.imagetopdf__slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.imagetopdf__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.imagetopdf__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.imagetopdf__slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn--small {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
}

.btn--success {
    background: var(--success);
    color: white;
}

.btn--success:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
}

.btn--danger {
    background: transparent;
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn[hidden] {
    display: none !important;
}

/* =====================================================
   ACTIONS
   ===================================================== */
.imagetopdf__actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =====================================================
   PROGRESS & MESSAGES
   ===================================================== */
.imagetopdf__progress {
    margin-top: 1.5rem;
    text-align: center;
}

.imagetopdf__progress[hidden] {
    display: none !important;
}

.imagetopdf__progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.imagetopdf__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.imagetopdf__progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.imagetopdf__success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: var(--success);
}

.imagetopdf__success[hidden] {
    display: none !important;
}

.imagetopdf__success p {
    margin: 0;
    font-weight: 600;
}

.imagetopdf__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
}

.imagetopdf__error[hidden] {
    display: none !important;
}

.imagetopdf__error p {
    margin: 0;
}

.imagetopdf__error svg {
    flex-shrink: 0;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.step-card__number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .imagetopdf__images-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .imagetopdf__images-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .imagetopdf__options-grid {
        grid-template-columns: 1fr;
    }
    
    .imagetopdf__actions {
        flex-direction: column;
    }
    
    .imagetopdf__actions .btn {
        width: 100%;
    }
    
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}
