* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-dark: #0f172a;
    --bg-dark-lighter: #1e293b;
    --text: #1f2937;
    --text-light: #6b7280;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    background: radial-gradient(circle at center, var(--bg-dark-lighter) 0%, var(--bg-dark) 100%);
    padding: 1rem;
    min-height: 100vh;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    body {
        padding: 2rem;
    }
}

.container {
    max-width: 90vw;
    margin: 0 auto;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
    .container {
        padding: 2rem;
        max-width: 1200px;
    }
}

h1 {
    text-align: center;
    color: var(--text);
    margin-bottom: 2rem;
    font-size: 1.875rem;
    font-weight: 700;
}

.upload-section {
    border: 2px dashed var(--border);
    padding: 2rem;
    text-align: center;
    border-radius: 1rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-light);
}

.upload-section:hover {
    border-color: var(--primary);
    background: white;
}

.upload-section.is-dragging {
    border-color: var(--primary);
    background: white;
}

.upload-section p {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.supported-types,
.setting-help {
    font-size: 0.75rem;
    color: var(--text-light);
}

.upload-section .icon {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.settings {
    margin-bottom: 2rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .settings {
        grid-template-columns: 1fr 1fr;
    }
}

.settings label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: white;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.images-section {
    position: relative;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 640px) {
    .images-section {
        gap: 1rem;
        flex-direction: row-reverse;
    }
}

.add-more-btn {
    display: flex;
    flex-direction: column;
    height: 50px;
    width: 100%;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: 50px; /* Changed to circle */
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.add-more-btn:hover {
    border-color: var(--primary);
    background: white;
}

.add-more-btn i {
    margin-top: 4px;
}

@media (min-width: 640px) {
    .add-more-btn {
        height: 80px;
        width: 80px;
    }
}

.images-grid {
    display: flex;
    flex: 1;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-light);
    min-width: 0;
    width: 100%;
}

@media (min-width: 640px) {
    .images-grid {
        gap: 1rem;
        padding: 1rem 0.5rem;
    }
}

/* Custom scrollbar styling */
.images-grid::-webkit-scrollbar {
    height: 8px;
}

.images-grid::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.images-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.images-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.image-item {
    background: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s ease;
    flex: 0 0 280px;
    overflow: visible;
}

@media (min-width: 640px) {
    .image-item {
        padding: 1rem;
        flex: 0 0 350px;
        max-width: 350px;
    }
}

.image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    display: block;
}

@media (min-width: 640px) {
    .image-preview {
        height: 150px;
    }
}

.file-size-info {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    padding: 0.25rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

.size-error {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: rgba(220, 38, 38, 0.8);
    border-radius: 0.25rem;
    color: white;
    font-size: 0.675rem;
    backdrop-filter: blur(10px);
}

.size-info {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.675rem;
    margin-right:5px;
    margin-left:5px;
}

.original-size, .compressed-size {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0.25rem;
    color: white;
    backdrop-filter: blur(10px);
}

.compressed-size, .compressed-size i {
    color: #93c5fd;
}

.last-download {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    color: var(--text-light);
}

.last-download i {
    color: #22c55e;
}

.download-time {
    color: var(--text-light);
    opacity: 0.7;
}

.download-history {
    text-align: center;
}

/* Remove overlay-related styles */
.image-preview-wrapper {
    margin-bottom: 1rem;
}

.remove-btn {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--danger);
    color: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    overflow: visible;
    z-index: 10;
}

.remove-btn:hover {
    background: var(--danger-hover);
    transform: scale(1.1);
}

.input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.filename-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.download-btn {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.download-btn i {
    font-size: 1rem;
}

@media (min-width: 640px) {
    .filename-input {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .download-btn {
        padding: 0.75rem 1rem;
        min-width: 100px;
        font-size: 0.875rem;
    }
}

/* Update existing button styles */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

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

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .button-group {
        display: grid;
        grid-template-columns: 0.5fr 1fr;
    }
}

.clear-all {
    background: var(--danger);
    padding: 1rem;
}

.clear-all:hover {
    background: var(--danger-hover);
}

.download-all {
    padding: 1rem;
}

.mobile-zip-note {
    display: block;
    font-size: 0.8em;
    opacity: 0.8;
}

#fileInput {
    display: none;
}

/* Loading state for buttons */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 1rem;
    top: calc(50% - 0.5rem);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(6px);
    }
}

@media (min-width: 640px) {
    .file-size-info {
        padding: 0.5rem;
    }

    .size-info {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .original-size, .compressed-size {
        padding: 0.25rem 0.5rem;
    }
} 
