@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    margin: 0;
    padding: 20px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: white;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("images/bg.webp") center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
}


h2 {
    color: #ffffff;
    margin-bottom: 32px !important;
}

#compressorContainer h2 {
    color: #fff;
}

.logo {
    display: block;
    width: 200px;
    height: auto;
    margin: 0 auto 32px;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 600px;
    box-sizing: border-box;
    margin: 20px auto;
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 32px);
        padding: 24px;
        margin: 16px;
        max-height: 85vh;
        border-radius: 20px;
    }

    body {
        padding: 16px 0;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
}

.custom-card {
    position: relative;
    z-index: 2;
    max-width: 600px;
    width: 90vw;
    padding: 32px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.17);
    box-sizing: border-box;
}

@media screen and (max-width: 480px) {
    .custom-card {
        width: calc(100% - 32px);
        min-width: auto;
        padding: 24px;
        margin: 16px;
    }
}

@media screen and (max-width: 375px) {
    .custom-card {
        width: calc(100% - 32px);
        min-width: auto;
        padding: 20px;
        margin: 16px;
    }
}

.white-button {
    width: 100%;
    border-radius: 12px;
    background-color: white;
    border: none;
    color: black;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 12px;
    cursor: pointer;
}

.white-button:hover {
    background-color: #f27a1a;
    color: white;
    
}

.custom-button {
    width: 100%;
    border-radius: 12px;
    background-color: #f27a1a;
    border: none;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 12px;
    cursor: pointer;
}

.custom-button:hover:not(:disabled) {
    background-color: #d86d17;
    
}

.custom-button:disabled {
    background-color: rgba(242, 122, 26, 0.5); /* #f27a1a with 0.5 opacity */
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

#progressContainer {
    display: none;
    text-align: center;
    margin: 16px 0px 0px 0px;
    color: white;
}

.progress-text {
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #f27a1a;
    transition: width 0.3s ease;
    font-size: 14px;
    font-weight: 700;
}

label {
    color: #fff;
}

.btn-outline-primary {
    color: #000;
    background-color: #fff;
    border-color: #fff;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #000;
    border-color: #000;
}

#compressMoreButton {
    width: 100%;
}

#compressMoreButton button {
    color: #000;
    background-color: #fff;
    border-color: #fff;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#compressMoreButton button:hover {
    color: #fff;
    background-color: #f27a1a;
    border-color: #f27a1a;
}

#originalSize {
    color: #fff;
    opacity: 1;
}

#compressedSize {
    color: #fff;
    font-weight: bold;
}

.custom-button.bg-emerald-600 {
    background-color: #f27a1a;
    color: white;
}

.custom-button.bg-emerald-600:hover {
    background-color: #d86d17;
   
}

/* Format Controls */
.format-selector {
    display: flex;
    height: 52px;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.format-button {
    flex: 1 1 calc(25% - 6px);
    min-width: 80px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.format-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.format-button.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 500;
}

input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-upload-container {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 32px;
    box-sizing: border-box;
}

.file-upload-container:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.file-upload-container.drag-over {
    border-color: #f27a1a;
    background: rgba(242, 122, 26, 0.1);
    box-shadow: 0 0 20px rgba(242, 122, 26, 0.2);
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 20px;
    color: white;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.upload-text {
    margin-top: 12px;
    font-size: 24px;
    color: white;
    opacity: 0.9;
    text-align: center;
}

.supported-formats {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    text-align: center;
    width: 100%;
}

.upload-hint {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.file-list {
    margin-top: 16px;
    
    width: 100%;
    
   
}

.file-list-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.file-list-item span:first-child {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.file-list-item span:last-child {
    flex-shrink: 0;
}

/* Modern number input styling */
input[type="number"] {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    padding: 12px;
    padding-right: 12px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Custom arrows container */
.number-input-wrapper {
    position: relative;
    width: 100%;
}

.number-input-arrows {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
}

.number-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    cursor: pointer;
    opacity: 0.7;
}

.number-arrow:hover {
    opacity: 1;
}

.number-arrow-up {
    border-bottom: 6px solid rgba(255, 255, 255, 0.8);
}

.number-arrow-down {
    border-top: 6px solid rgba(255, 255, 255, 0.8);
}

#successMessage {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.check-icon {
    width: 20px;
    height: 20px;
    stroke: #f27a1a;
    flex-shrink: 0;
}

/* Image Compare Styles */
.image-compare-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    user-select: none;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.original-image {
    z-index: 1;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.compressed-image {
    z-index: 0;
}

.image-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 2;
    cursor: col-resize;
    display: flex;
    justify-content: center;
}

.slider-handle {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.slider-handle::before {
    content: '↔';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.image-slider:hover .slider-handle::before {
    background: white;
    width: 36px;
    height: 36px;
    font-size: 22px;
}

.image-label {
    position: absolute;
    color: white;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.image-label span {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.original-image .image-label {
    left: 16px;
    top: 16px;
}

.compressed-image .image-label {
    right: 16px;
    top: 16px;
    text-align: right;
}

.image-label:hover {
    background: rgba(0, 0, 0, 0.75);
   
}

@media (max-width: 768px) {
    .image-compare-container {
        border-radius: 8px;
        aspect-ratio: 16/9;
    }
    
    .slider-handle::before {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .image-slider:hover .slider-handle::before {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .image-label {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .image-label span {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .image-compare-container {
        aspect-ratio: 16/9;
    }
    
    .image-label {
        padding: 6px 12px;
        font-size: 14px;
    }
}

input[type="file"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Resize Controls Styles */
.resize-controls {
    margin-bottom: 24px;
}

.resize-controls h3,
.block.text-white.mb-2 {
    color: white;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
    opacity: 0.8;
}

.aspect-ratio-selector {
    margin-bottom: 16px;
}

.aspect-ratio-buttons {
    display: flex;
    height: 52px;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.aspect-ratio-button {
    flex: 1;
    min-width: 80px;
    height: 52px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.aspect-ratio-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.aspect-ratio-button.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 500;
}

.custom-dimensions {
    margin-top: 16px;
}

.dimension-inputs {
    display: flex;
    gap: 8px;
    width: 100%;
}

.input-group {
    flex: 1;
}

.input-group input {
    width: 100%;
    height: 52px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.custom-input:focus {
    outline: none;
    
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 480px) {
    .aspect-ratio-buttons {
        height: auto;
        margin-bottom: 24px;
    }
    
    .aspect-ratio-button {
        flex: 1 1 calc(33.33% - 6px);
        height: 52px;
    }

    .dimension-inputs {
        flex-direction: column;
        gap: 12px;
    }
}

.image-preview-container {
    width: 100%;
    margin-top: 20px;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-preview-item:hover {
    
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.image-preview-item:hover img {
    transform: scale(1.05);
}

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

.image-preview-item .remove-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.image-preview-item .remove-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.image-preview-item .remove-button::before,
.image-preview-item .remove-button::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background: white;
}

.image-preview-item .remove-button::before {
    transform: rotate(45deg);
}

.image-preview-item .remove-button::after {
    transform: rotate(-45deg);
}

.image-preview-item .size-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: center;
    backdrop-filter: blur(4px);
    z-index: 2;
}

@media (max-width: 768px) {
    .image-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .image-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.comparison-info-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    border-radius: 8px;
}

#compressedSizeText {
    color: #f27a1a;
}