/* Reduce Image Size Page Styles */
.reduce-image-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(103, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.tip-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.tip-item span {
    color: #2c3e50;
    font-weight: 500;
}

.drag-drop-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8f2ff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drag-drop-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(103, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.drag-drop-area:hover::before {
    left: 100%;
}

.drag-drop-area:hover {
    border-color: #5a6fd8;
    background: linear-gradient(135deg, #e8f2ff 0%, #d1e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(103, 126, 234, 0.2);
}

.drag-drop-area.drag-over {
    border-color: #52c41a;
    background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(82, 196, 26, 0.3);
}

.drag-drop-area.drag-over .upload-icon {
    color: #52c41a;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.drag-drop-area h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.drag-drop-area p {
    color: #666;
    margin-bottom: 1rem;
}

.supported-formats small {
    color: #888;
    font-size: 0.9rem;
}

/* Gallery Section */
.gallery-section {
    margin-bottom: 3rem;
}

.gallery-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-info {
    padding: 1rem;
    background: #fff;
}

.gallery-filename {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-size {
    font-size: 0.8rem;
    color: #666;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Controls Section */
.controls-section {
    margin-bottom: 3rem;
}

.controls-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.controls-container {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.preset-controls,
.custom-controls,
.size-controls {
    margin-bottom: 2rem;
}

.preset-controls label,
.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.preset-controls select,
.control-group input,
.control-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #fff;
}

.preset-controls select:focus,
.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(103, 126, 234, 0.1);
}

.dimension-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.control-group input:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.custom-size-input {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(103, 126, 234, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(103, 126, 234, 0.2);
}

.custom-size-input input {
    border-color: #667eea;
}

.custom-size-input .size-hint {
    display: block;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

.custom-target-size-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 12px;
    border: 2px solid rgba(103, 126, 234, 0.1);
}

.custom-target-size-section h3 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-target-size-section h3::before {
    content: '🎯';
}

.custom-target-size-section p {
    color: #666;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.custom-size-controls {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.size-example {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(82, 196, 26, 0.1);
    border-radius: 6px;
    border-left: 4px solid #52c41a;
}

.size-example small {
    color: #2c3e50;
    font-weight: 500;
}

.size-example i {
    color: #52c41a;
    margin-right: 0.5rem;
}

.convert-button-container {
    text-align: center;
    margin-top: 2rem;
}

.convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(103, 126, 234, 0.3);
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(103, 126, 234, 0.4);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.convert-btn i {
    margin-right: 0.5rem;
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin: 0;
}

.download-all-btn {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(82, 196, 26, 0.3);
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 196, 26, 0.4);
}

.download-all-btn i {
    margin-right: 0.5rem;
}

.results-container {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
    gap: 1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: #f8f9ff;
}

.result-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-info h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.result-info p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-info p::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.size-increase {
    color: #1890ff !important;
}

.size-decrease {
    color: #52c41a !important;
}

.size-unchanged {
    color: #666 !important;
}

.result-size,
.result-dimensions {
    text-align: center;
    color: #2c3e50;
    font-weight: 600;
}

.result-size {
    color: #52c41a;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(103, 126, 234, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reduce-image-container {
        padding: 1rem;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .drag-drop-area {
        padding: 2rem 1rem;
    }
    
    .dimension-controls {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .result-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .controls-container {
        padding: 1rem;
    }
    
    .convert-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .download-all-btn {
        width: 100%;
    }
}