/* Image Compressor Tool Styles */

/* Tool Container */
.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: #f8fafc;
    min-height: 100vh;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    animation: float 3s ease-in-out infinite;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.tool-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tool-description {
    font-size: 1.25rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Section Cards */
.section-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
}

.section-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.section-header h2,
.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.preview-stats,
.results-summary {
    font-size: 0.875rem;
    color: #718096;
    margin-left: auto;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #667eea;
    background: #edf2f7;
    transform: scale(1.02);
}

.upload-content h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 1rem 0 0.5rem;
}

.upload-content p {
    color: #718096;
    margin: 0.5rem 0;
}

.upload-icon {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 1rem;
}

.upload-info {
    font-size: 0.875rem;
    color: #a0aec0;
    margin-top: 1rem;
}

/* URL Upload */
.url-upload {
    margin-top: 1.5rem;
    text-align: center;
}

.url-input {
    margin-top: 1rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.settings-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.settings-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.preset-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preset-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.preset-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.preset-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.preset-btn span {
    font-weight: 600;
    font-size: 0.875rem;
}

.preset-btn small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.preset-btn.active small {
    opacity: 0.9;
}

/* Control Groups */
.control-group {
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Quality Slider */
.quality-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #f56565 0%, #ed8936 50%, #48bb78 100%);
    outline: none;
    appearance: none;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.quality-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 3px solid #667eea;
}

.quality-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quality-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.quality-indicator {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

.quality-indicator.low {
    color: #f56565;
}

.quality-indicator.medium {
    color: #ed8936;
}

.quality-indicator.high {
    color: #48bb78;
}

/* Form Elements */
.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4a5568;
    gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.privacy-icon,
.speed-icon {
    margin-left: 0.5rem;
    color: #667eea;
}

/* Compression Actions */
.compression-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4);
}

.btn-outline {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-link {
    background: none;
    color: #667eea;
    border: none;
    padding: 0.5rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: #5a67d8;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
}

/* Image Previews Grid */
.image-previews-grid,
.compressed-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.image-preview-card,
.compressed-image-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.image-preview-header,
.compressed-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.image-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    truncate: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.image-size {
    font-size: 0.75rem;
    color: #718096;
}

.image-container {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 250px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.preview-image,
.compressed-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.compression-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.size-reduction {
    font-weight: 600;
    color: #48bb78;
}

.original-size,
.compressed-size {
    font-size: 0.75rem;
    color: #718096;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
}

.image-actions .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Results Actions */
.results-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Progress Section */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.progress-details {
    font-size: 0.875rem;
    color: #718096;
}

.processing-queue {
    display: grid;
    gap: 1rem;
}

.processing-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.processing-item.processing {
    border-color: #667eea;
    background: #edf2f7;
}

.processing-item.completed {
    border-color: #48bb78;
    background: #f0fff4;
}

.processing-item.error {
    border-color: #f56565;
    background: #fed7d7;
}

.processing-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.875rem;
    color: white;
}

.processing-item.processing .processing-icon {
    background: #667eea;
    animation: pulse 2s infinite;
}

.processing-item.completed .processing-icon {
    background: #48bb78;
}

.processing-item.error .processing-icon {
    background: #f56565;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.processing-info {
    flex: 1;
}

.processing-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.processing-status {
    font-size: 0.75rem;
    color: #718096;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 300px;
    margin: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-content h3 {
    font-size: 1.25rem;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.loading-content p {
    color: #718096;
    font-size: 0.875rem;
}

/* Notification */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    max-width: 400px;
    min-width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.notification.success {
    border-left-color: #48bb78;
}

.notification.success .notification-icon {
    background: #48bb78;
}

.notification.error {
    border-left-color: #f56565;
}

.notification.error .notification-icon {
    background: #f56565;
}

.notification.warning {
    border-left-color: #ed8936;
}

.notification.warning .notification-icon {
    background: #ed8936;
}

.notification.info {
    border-left-color: #4299e1;
}

.notification.info .notification-icon {
    background: #4299e1;
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    color: #2d3748;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #718096;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* SEO Content */
.seo-content {
    max-width: 800px;
    margin: 4rem auto 0;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.seo-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.seo-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2rem 0 1rem;
}

.seo-section p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.seo-section ul,
.seo-section ol {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-section li {
    margin-bottom: 0.5rem;
}

.seo-section strong {
    color: #2d3748;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem 0.5rem;
    }

    .tool-icon {
        width: 60px;
        height: 60px;
    }

    .tool-icon i {
        font-size: 2rem;
    }

    .tool-title {
        font-size: 2rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .section-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .preset-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .input-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-actions {
        flex-direction: column;
        align-items: center;
    }

    .results-actions .btn {
        width: 100%;
        max-width: 250px;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .notification {
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
        min-width: auto;
    }

    .loading-content {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .seo-content {
        margin: 2rem auto 0;
        padding: 1.5rem;
    }

    .seo-section h2 {
        font-size: 1.5rem;
    }

    .seo-section h3 {
        font-size: 1.125rem;
    }

    .image-previews-grid,
    .compressed-images-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.5rem 0.25rem;
    }

    .section-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .tool-title {
        font-size: 1.75rem;
    }

    .section-header h2,
    .section-header h3 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .btn-large {
        padding: 1rem 1.5rem;
    }

    .upload-area {
        padding: 1.5rem 0.75rem;
    }

    .upload-content h3 {
        font-size: 1.125rem;
    }

    .preset-btn {
        padding: 0.875rem;
    }

    .image-container {
        min-height: 150px;
        max-height: 200px;
    }
}

/* Touch Interactions */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
    }

    .preset-btn:active {
        transform: scale(0.98);
    }

    .upload-area:active {
        transform: scale(0.99);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .tool-icon {
        box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    }

    .preview-image,
    .compressed-image {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tool-container {
        background: #1a202c;
    }

    .section-card {
        background: #2d3748;
        border-color: #4a5568;
    }

    .tool-title {
        color: #f7fafc;
    }

    .tool-description {
        color: #e2e8f0;
    }

    .section-header h2,
    .section-header h3 {
        color: #f7fafc;
    }

    .control-label {
        color: #e2e8f0;
    }

    .form-input,
    .form-select {
        background: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }

    .form-input:focus,
    .form-select:focus {
        border-color: #667eea;
        background: #2d3748;
    }

    .preset-btn {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }

    .preset-btn:hover {
        background: #2d3748;
        border-color: #667eea;
        color: #667eea;
    }

    .image-container {
        background: #4a5568;
        border-color: #718096;
    }

    .settings-card {
        background: #374151;
        border-color: #4a5568;
    }

    .upload-area {
        background: #374151;
        border-color: #4a5568;
    }

    .upload-area:hover,
    .upload-area.drag-over {
        background: #2d3748;
        border-color: #667eea;
    }

    .upload-content h3 {
        color: #f7fafc;
    }

    .upload-content p {
        color: #a0aec0;
    }

    .seo-content {
        background: #2d3748;
        border-color: #4a5568;
    }

    .seo-section h2,
    .seo-section h3 {
        color: #f7fafc;
    }

    .seo-section p,
    .seo-section li {
        color: #e2e8f0;
    }

    .notification {
        background: #2d3748;
    }

    .notification-message {
        color: #f7fafc;
    }

    .loading-content {
        background: #2d3748;
    }

    .loading-content h3 {
        color: #f7fafc;
    }

    .loading-content p {
        color: #a0aec0;
    }

    .image-preview-card,
    .compressed-image-card {
        background: #4a5568;
        border-color: #718096;
    }

    .compression-stats {
        background: #374151;
    }

    .processing-item {
        background: #374151;
        border-color: #4a5568;
    }
}
