/**
 * Image Converter Custom CSS
 * Using only Bootstrap basic classes (container, row, col) with custom styling
 */

 :root {
    --color-primary: #0dc270;
    --hover-primary: #0bab62;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --typo-dark: #100727;
    --typo-light: #625C70;
    --color-border: #f1f1f1;
    --light-bg-color: #f9f9f9;
}

/* ===========================================
   Main Container & Layout
=========================================== */
.axilweb-image-converter {
    /* padding: 40px 0; */
    /* background: #f8f9fa; */
    /* min-height: 100vh; */
}

/* Header Section */
.converter-header {
    text-align: center;
    margin-bottom: 50px;
}

.header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.header-icon i {
    font-size: 2.5rem;
    color: white;
}

.converter-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.converter-header p {
    font-size: 1.125rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

/* ===========================================
   Upload Section
=========================================== */
.axilweb-upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.axilweb-upload-wrapper {
    position: relative;
}

.axilweb-upload-area {
    border: 3px dashed var(--color-border);
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #fafbfc;
}

.axilweb-upload-area:hover {
    border-color: var(--color-primary);
    background: rgba(0, 123, 255, 0.02);
}

.axilweb-upload-area.dragover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
}

.axilweb-upload-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.axilweb-upload-content p {
    color: #6c757d;
    margin-bottom: 25px;
}

.axilweb-upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.axilweb-upload-icon i {
    font-size: 2rem;
    color: #6c757d;
}

.axilweb-upload-area:hover .axilweb-upload-icon {
    background: var(--color-primary);
    transform: scale(1.1);
}

.axilweb-upload-area:hover .axilweb-upload-icon i {
    color: white;
}

.axilweb-file-types {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.axilweb-file-types span {
    min-width: 50px;
    background: #e9ecef;
    color: var(--typo-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 500;
}

.axilweb-file-limit {
    font-size: 1.4rem;
    color: var(--typo-light);
}

/* Upload Overlay */
.axilweb-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.9);
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
}

.axilweb-overlay-content {
    text-align: center;
    color: white;
}

.axilweb-overlay-content i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.axilweb-overlay-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ===========================================
   File Preview & Upload Table
=========================================== */
.axilweb-file-upload-wrapper {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--color-border);
}

.axilweb-file-upload-wrapper h4 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--typo-dark);
    margin-bottom: 3rem;
}

.axilweb-upload-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.axilweb-upload-images-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.axilweb-upload-images-table th,
.axilweb-upload-images-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    white-space: nowrap;
}

.axilweb-upload-images-table th:last-child,
.axilweb-upload-images-table td:last-child {
    text-align: right;
    width: 100px;
}

.axilweb-upload-images-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: var(--typo-dark);
    font-size: 1.6rem;
    text-transform: uppercase;
}

.axilweb-upload-images-table tbody tr:hover {
    background: #f8f9fa;
}

.axilweb-upload-images-table tbody tr:last-child td {
    border-bottom: none;
}

.axilweb-upload-images-table .summary-row {
    background-color: #f8f9fa; 
    border-top: 2px solid  var(--color-primary);
}

/* Preview image in table */
.table-preview-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.file-name-cell {
    font-size: 1.6rem;
    color: var(--typo-dark);
    /* min-width: 200px; */
    word-break: break-word;
}

.file-size-cell {
    color: #6c757d;
    font-size: 1.6rem;
}

.status-cell {
    font-size: 1.6rem;
    transition: all 0.3s ease;
    min-width: 120px;
}

.status-pending {
    color: #6c757d;
}

.status-processing {
    color: #007bff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-completed {
    color: #28a745;
    font-size: 1.6rem;
}

.status-error {
    color: #dc3545;
    font-weight: 500;
}

.processing-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

.webp-size-cell {
    font-size: 1.6rem;
    color: #28a745;
}

.savings-cell {
    font-size: 1.6rem;
    color: #28a745;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}
.remove-btn:focus {
    outline: none;
}

.download-btn-small {
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 1.3rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex; /* Changed from none to inline-flex */
    align-items: center;
    gap: 5px;
    height: 32px;
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
}

.download-btn-small.show {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.download-btn-small i {
    margin-right: 0; /* Removed margin since using gap */
}

.download-btn-small:hover {
    background: var(--hover-primary);
    color: #ffffff;
    text-decoration: none;
    transform: scale(1.05);
}

/* Legacy file preview styles for backward compatibility */
.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.file-preview-item {
    position: relative;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.file-preview-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.remove-file-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.remove-file-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.preview-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-size {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ===========================================
   Action Buttons
=========================================== */
.axilweb-action-buttons {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--color-border);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.axilweb-btn-convert,
.axilweb-btn-reset {
    display: flex;
    place-items: center;
    gap: 6px;
    font-size: 1.3rem;
    color: var(--color-primary);
    font-weight: 600;
    border: 0.2rem solid var(--color-primary);
    background-color: transparent;
    border-radius: 4rem;
    padding: .8rem 2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.axilweb-btn-convert span {
    display: flex;
    place-items: center;
    gap: 6px;
}

.axilweb-btn-convert {
    background-color: var(--color-primary);
    color: #ffffff;
}
.axilweb-btn-convert:hover:not(:disabled) {
    background-color: var(--hover-primary);
    border-color: var(--hover-primary);
    transform: translateY(-2px);
}

.axilweb-btn-convert:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}
.axilweb-btn-convert:focus {
    outline: none;
}

.axilweb-btn-reset:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-1px);
}
.axilweb-btn-reset:focus {
    outline: none;
}

/* ===========================================
   Settings Section
=========================================== */
.axilweb-settings-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.axilweb-settings-header h4 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--typo-dark);
    margin-bottom: 30px;
}

.axilweb-settings-header h4 i {
    color: #007bff;
    margin-right: 8px;
}

.axilweb-settings-header p {
    color: var(--typo-light);
    font-size: 1.6rem;
}

.axilweb-quality-control {
    position: relative;
}

.axilweb-quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.6rem;
}

.axilweb-quality-header label {
    margin: 0;
    font-weight: 500;
    color: var(--typo-dark);
}

.axilweb-quality-value {
    font-weight: 700;
    color: var(--color-primary);
}

#webpQuality {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    margin-bottom: 10px;
    -webkit-appearance: none;
}

#webpQuality::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

#webpQuality::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.axilweb-quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    color: var(--typo-light);
}

/* ===========================================
   Progress Section
=========================================== */
.progress-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-header {
    text-align: center;
    margin-bottom: 30px;
}

.progress-header i {
    font-size: 2.5rem;
    color: #007bff;
    margin-bottom: 15px;
}

.progress-header h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.progress-header p {
    color: #6c757d;
}

.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e9ecef;
}

.progress-item.processing {
    border-left-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.progress-item.completed {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.progress-item.error {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.progress-info .file-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 3px;
}

.progress-status {
    font-size: 0.875rem;
    color: #6c757d;
}

.progress-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.progress-icon.success {
    background: #28a745;
    color: white;
}

.progress-icon.error {
    background: #dc3545;
    color: white;
}

/* ===========================================
   Results Section
=========================================== */
.results-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header i {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 15px;
}

.results-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--success-color);
    color: #ffffff;
    border: none;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-download:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    text-decoration: none;
}

/* ===========================================
   Results Table
=========================================== */
.results-table {
    margin-top: 30px;
    overflow-x: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table th,
.results-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table td {
    vertical-align: middle;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info i {
    color: #007bff;
    font-size: 1.125rem;
}

.savings {
    color: #28a745;
    font-weight: 600;
}

.btn-download-single {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-download-single:hover {
    background: #0056b3;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* ===========================================
   Responsive Design
=========================================== */
@media (max-width: 768px) {
    .converter-header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-convert,
    .btn-reset {
        justify-content: center;
        width: 100%;
    }
    
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .results-table {
        font-size: 0.875rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 8px;
    }
}

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

/* Upload area states */
.axilweb-upload-area.has-files {
    border-style: solid;
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.axilweb-upload-area.has-files .axilweb-upload-icon {
    background: #28a745;
}

.axilweb-upload-area.has-files .axilweb-upload-icon i {
    color: white;
}

.axilweb-upload-area.has-files .axilweb-upload-content h3 {
    color: #28a745;
}

/* Button loading states */
.axilweb-btn-loading {
    display: none;
}

