/* JPG to PDF Converter Styles */
.converter-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.upload-area {
    border: 2px dashed #0078d4;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 20;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.upload-area:hover {
    border-color: #005a9e;
    background: #e3f2fd;
}

.upload-area.dragover {
    border-color: #005a9e;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: #0078d4;
    margin-bottom: 1rem;
    display: block;
}

.upload-area p {
    margin: 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.upload-hint {
    color: #666;
    font-size: 0.9rem;
}

/* File input styling */
#fileInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 25;
}

.files-list {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.files-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.file-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item img {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.file-item .file-name {
    font-size: 0.9rem;
    color: #333;
    word-break: break-all;
}

.files-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 5;
}

.files-count {
    color: #666;
    font-size: 0.9rem;
}

.preview-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.preview-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.image-preview {
    text-align: center;
    background: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #ddd;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.result-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.pdf-info {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #ddd;
}

.pdf-info h3 {
    color: #0078d4;
    margin-bottom: 0.5rem;
}

.pdf-info p {
    margin: 0.25rem 0;
    color: #666;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-primary {
    background: #0078d4;
    color: white;
}

.btn-primary:hover {
    background: #005a9e;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
    z-index: 1;
}

/* Button hover and active states */
.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 15;
}

.btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 15;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: #0078d4;
    transition: width 0.3s ease;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .converter-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-area i {
        font-size: 2rem;
    }
    
    .files-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .preview-header,
    .result-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preview-actions,
    .result-actions {
        justify-content: center;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .upload-area {
        background: #2d2d2d;
        border-color: #3a9fff;
    }
    
    .upload-area:hover {
        background: #1e3a5f;
        border-color: #3a9fff;
    }
    
    .upload-area p {
        color: #fff;
    }
    
    .upload-hint {
        color: #aaa;
    }
    
    .files-list,
    .preview-area,
    .result-area {
        background: #2d2d2d;
    }
    
    .file-item {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .file-item .file-name {
        color: #fff;
    }
    
    .image-preview,
    .pdf-info {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .pdf-info h3 {
        color: #3a9fff;
    }
    
    .pdf-info p {
        color: #aaa;
    }
}
