/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header .subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Trust Note */
.trust-note {
    background-color: #e8f4fc;
    border-left: 4px solid #3498db;
    padding: 12px 18px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trust-note i {
    color: #3498db;
    font-size: 1.3rem;
}

.trust-note p {
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Section Common Styles */
section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 25px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.section-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Upload Section - Made more compact */
.upload-section {
    padding: 20px !important;
}

.upload-area {
    border: 3px dashed #d1d8e0;
    border-radius: 10px;
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.upload-area.drag-over {
    border-color: #2ecc71;
    background-color: #e8f8f0;
}

.upload-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-area h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.upload-hint {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 1rem;
}

.upload-controls {
    margin-bottom: 15px;
}

#fileInput {
    display: none;
}

.browse-btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.browse-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.file-types {
    margin-top: 15px;
    color: #95a5a6;
    font-size: 0.85rem;
}

.upload-progress {
    margin-top: 20px;
    display: none;
}

.progress-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #2ecc71;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Thumbnails Section */
.thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
    min-height: 100px;
}

.thumbnail-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: move;
}

.thumbnail-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.thumbnail-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.thumbnail-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
}

.thumbnail-actions {
    display: flex;
    justify-content: flex-end;
}

.remove-btn {
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background-color: rgba(192, 57, 43, 0.9);
    transform: scale(1.1);
}

.thumbnail-info {
    color: white;
}

.thumbnail-info .index {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.thumbnail-info .name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    color: white;
    background-color: rgba(52, 152, 219, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #d1d8e0;
}

.thumbnail-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

/* Options Section */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option-card {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    padding: 22px;
    transition: all 0.3s ease;
}

.option-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.option-header i {
    font-size: 1.6rem;
    color: #3498db;
}

.option-header h3 {
    font-size: 1.2rem;
    color: #2c3e50;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 14px;
    border-radius: 8px;
    border: 2px solid #e0e6ed;
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.radio-option input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #bdc3c7;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-option input:checked + .radio-custom {
    border-color: #3498db;
    background-color: #3498db;
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 2px solid #e0e6ed;
    background-color: white;
    font-size: 1rem;
    color: #2c3e50;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #3498db;
}

.select-wrapper i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    pointer-events: none;
}

.generate-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 22px;
    border-top: 1px solid #e0e6ed;
}

.file-info {
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.file-info i {
    color: #3498db;
}

/* Download Section */
.download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e0e6ed;
}

.download-icon {
    font-size: 3.5rem;
    color: #e74c3c;
}

.download-info h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.download-info p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #d1d8e0;
}

.btn-secondary:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.footer i {
    color: #e74c3c;
    margin: 0 4px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 18px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .generate-section {
        flex-direction: column;
        gap: 18px;
        align-items: stretch;
    }
    
    .download-card {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .thumbnail-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .upload-area {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .upload-area {
        padding: 25px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .upload-area h2 {
        font-size: 1.3rem;
    }
    
    .thumbnail-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}