* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bricolage-grotesque-kodio {
  font-family: "Bricolage Grotesque", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}

body {
    background-color: #f9fbfc;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    font-family: "Bricolage Grotesque", serif;
    font-weight: 400;
}

.container {
    max-width: 1100px;
    width: 100%;
}

h1, h2 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
}

.upload-container {
    background: #ebf7ff;
    border: 2px dashed #97cff9;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-container:hover {
    border-color: #40a2eb;
}

.upload-container.dragover {
    border-color: #2196f3;
    background: #e3f2fd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#uploadIcon {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.images-list {
    margin-top: 2rem;
}

.images-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.image-item-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.image-title {
    order: 2;
}

.image-item h3 {
    color: #333;
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    order: 1;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.image-preview .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Progress bar styles */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #2196f3;
    transition: width 0.3s ease;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading .placeholder {
    animation: pulse 1.5s infinite ease-in-out;
}

.image-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.image-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    order: 3;
}

.compression-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pending {
    background: #ffd700;
}

.status-complete {
    background: #4caf50;
}

.status-error {
    background: #f44336;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgb(227 227 227);
}
.batch-actions.visible {
    opacity: 1;
    visibility: visible;
}

.optimizing-message {
    text-align: center;
    color: #2196f3;
    font-size: 1.1rem;
    margin-top: 1rem;
    display: none;
}

.optimizing-message.visible {
    display: block;
    animation: pulse 1.5s infinite ease-in-out;
}

span.image-size {
    font-size: 11px;
    opacity: 0.6;
}

.regenerate-btn {
    padding: 0.75rem 1.5rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.regenerate-btn:hover {
    background-color: #45a049;
}

.regenerate-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.regenerate-btn::before {
    content: '🔄';
    font-size: 1.1rem;
}

.download-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 1rem 2rem;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #1976d2;
}

.download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.total-savings {
    font-size: 1.1rem;
    color: #4caf50;
    font-weight: 500;
}

.single-download-btn {
    background: #d5f0e2;
    border: none;
    color: #3d9463;
    border-radius: 4px;
    padding: 7px 10px;
    font-weight: 600;
}

.single-download-btn:hover {
    background: #b1e0c7;;
}

.single-download-btn svg {
    width: 20px;
    height: 20px;
}

.image-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 1rem;
    border-left: 1px solid #eee;
}

@media (max-width: 600px) {
    .image-item {
        flex-direction: row;
        align-items: center;
        padding: 0.75rem;
    }
    
    .image-preview {
        width: 48px;
        height: 48px;
    }

    .image-actions {
        margin-left: auto;
        margin-top: 0;
        padding-left: 1rem;
        border-left: 1px solid #eee;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 10px;
    padding: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.2rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
}

/* Image comparison slider */
.comparison-slider {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 400px;
    border-radius: 5px;
    overflow: hidden;
}

.comparison-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.comparison-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.comparison-item.original {
    clip-path: inset(0 50% 0 0);
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: white;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.slider-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-handle::after {
    content: '⇄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 20px;
}

.image-labels {
    position: absolute;
    top: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.compression-settings {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.compression-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.compression-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.compression-toggle input:checked + .toggle-slider {
    background: #2196f3;
}

.compression-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 1rem;
    color: #333;
}

.compression-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.format-select {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.format-select label {
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.format-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-checkbox:hover {
    border-color: #2196f3;
    background: rgba(33, 150, 243, 0.05);
}

.format-checkbox input[type="checkbox"] {
    margin: 0;
}

.format-checkbox input[type="checkbox"]:checked + label {
    color: #2196f3;
}

.format-select select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.format-select select:hover {
    border-color: #2196f3;
}

.format-select select:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.format-popover {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.format-popover.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
    display: block;
}

.format-list {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.format-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.format-popover-item:hover {
    background-color: #f5f5f5;
}

.format-icon {
    font-size: 1.2em;
}

.download-all-formats {
    padding: 8px 0;
}

.single-download-btn {
    position: relative;
    padding: 8px 16px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.single-download-btn:hover {
    background: #1976d2;
}

.single-download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

span.compressed-size span {
    font-size: 11px;
    opacity: 0.6;
}

span.compressed-size {
    display: flex
;
    flex-direction: column;
    align-items: flex-end;
}