/* Image Compressor Specific Styles */

/* Upload Area */
.upload-area {
    margin-bottom: 2rem;
}

.upload-box {
    background: var(--card-bg);
    border: 2px dashed var(--card-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background: rgba(255, 77, 141, 0.05);
}

.upload-icon {
    margin-bottom: 1.5rem;
}

.upload-icon i {
    font-size: 4rem;
    color: var(--primary-color);
}

.upload-box h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.upload-box p {
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}

.btn-upload {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 77, 141, 0.3);
}

.upload-info {
    margin-top: 1rem;
}

.upload-info small {
    color: var(--text-color-light);
    font-size: 0.85rem;
}

/* Drag and Drop Effects */
.upload-area.drag-over .upload-box {
    border-color: var(--primary-color);
    background: rgba(255, 77, 141, 0.1);
    transform: scale(1.02);
}

.upload-area.drag-over .upload-icon i {
    animation: bounce 0.6s ease-in-out infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    min-height: 200px;
}

.image-file-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.image-file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-preview {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    position: relative;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-file-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-file-size {
    font-size: 0.75rem;
    color: var(--text-color-light);
    margin-bottom: 0.5rem;
}

.image-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.image-status.ready {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.image-status.processing {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.image-status.completed {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.remove-file-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Compression Settings */
.compression-settings {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.setting-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.setting-select,
.setting-input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.1);
}

.quality-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 10px;
    cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.quality-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.editor-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    position: relative;
}

.image-preview-panel {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#image-preview {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
}

.options-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 10px;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.results-display {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

.results-display p {
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
}

.results-display strong {
    color: var(--primary-color);
}

.action-buttons {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: var(--primary-color);
}


/* Loading overlay should be positioned inside the editor area */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(13, 13, 26, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 16px;
    color: white;
    height: 100vh;
}

.loading-overlay p {
    margin-top: 1.5rem;
}

.spinner {
    border: 4px solid var(--card-border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.compress-action {
    text-align: center;
    margin-bottom: 2rem;
}

.btn-compress {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 77, 141, 0.3);
}

.btn-compress:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 77, 141, 0.4);
    background: linear-gradient(135deg, #d43f8d, #a23f8d);
}

.btn-compress:active {
    transform: translateY(0);
}

.btn-compress:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-compress i {
    font-size: 1.2rem;
}

#results-area {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

#results-area h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.results-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.results-summary p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.results-summary strong {
    color: var(--primary-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-image-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.result-image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-image-preview {
    width: 100%;
    height: 100px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-image-name {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-image-info {
    font-size: 0.75rem;
    color: var(--text-color-light);
    margin-bottom: 0.5rem;
}

.btn-download-single {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download-single:hover {
    background: #d43f8d;
}

.download-actions {
    text-align: center;
}

.btn-download-all {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 77, 141, 0.3);
}

.btn-download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 77, 141, 0.4);
    background: linear-gradient(135deg, #d43f8d, #a23f8d);
}

@media screen and (max-width: 900px) {
    .editor-area {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .compression-settings {
        flex-direction: column;
        gap: 1rem;
    }

    .setting-group {
        min-width: 100%;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .editor-area {
        grid-template-columns: 1fr;
    }
}