* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 90vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
}

header p {
    opacity: 0.9;
    font-size: 1em;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    min-height: 600px;
}

/* Control Panel */
.control-panel {
    background: #f8f9fa;
    padding: 25px;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.upload-content h3 {
    color: #333;
    margin-bottom: 8px;
}

.upload-content p {
    color: #666;
    margin: 8px 0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-process {
    background: #28a745;
    color: white;
    font-size: 16px;
    padding: 15px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-process:hover {
    background: #218838;
}

.btn-process:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-download {
    background: #17a2b8;
    color: white;
    padding: 12px 20px;
    width: 100%;
}

.btn-download:hover {
    background: #138496;
}

.file-info {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

#imagePreview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.file-details h4 {
    color: #333;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-details p {
    color: #666;
    margin-bottom: 2px;
    font-size: 0.9em;
}

.processing-options h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.option-group {
    background: white;
    padding: 18px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.option-group h4 {
    margin-bottom: 12px;
    color: #333;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.format-options, .filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

/* Preview Panel */
.preview-panel {
    background: white;
    position: relative;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.placeholder-content h3 {
    margin-bottom: 10px;
    color: #495057;
}

.preview-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    color: #333;
    margin: 0;
}

.preview-tabs {
    display: flex;
    gap: 5px;
    background: #e9ecef;
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-container {
    flex: 1;
    padding: 25px;
    overflow: auto;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

.single-view {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-label {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

#originalImage, #processedImage {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.image-info {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.processed-actions {
    margin-top: auto;
    width: 100%;
    max-width: 300px;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .control-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .preview-tabs {
        width: 100%;
    }
    
    .tab-btn {
        flex: 1;
    }
}

/* Add these new styles to your existing CSS */

/* File Size Target Styles */
.size-info {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
    padding: 3px 6px;
    background: #f8f9fa;
    border-radius: 3px;
    display: inline-block;
}

.file-actions {
    margin-top: 10px;
    text-align: center;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.help-text {
    color: #6c757d;
    font-size: 0.8em;
    margin-top: 5px;
    display: block;
}

.size-preview {
    margin-top: 15px;
}

.size-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.size-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.size-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #6c757d;
}

.size-comparison {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.size-reduction {
    font-weight: 600;
}

.size-reduction.good {
    color: #28a745;
}

.size-reduction.warning {
    color: #ffc107;
}

.size-reduction.bad {
    color: #dc3545;
}

/* Enhanced file info styles */
.file-details {
    flex: 1;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

#imagePreview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e9ecef;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-preview {
        flex-direction: column;
        text-align: center;
    }
    
    #imagePreview {
        width: 100px;
        height: 100px;
    }
    
    .file-actions {
        margin-top: 15px;
    }
}

/* FAQ Section with Proper Spacing */
.faq-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    margin-top: 60px;
    border-top: 1px solid #dee2e6;
}

.faq-section .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.faq-header {
    text-align: center;
    margin-bottom: 60px;
}

.faq-header h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

.faq-subtitle {
    font-size: 1.2em;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.faq-item {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.faq-item h3 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.4;
    padding-right: 40px;
}

.faq-answer {
    color: #555;
    line-height: 1.7;
}

.faq-answer p {
    margin-bottom: 15px;
    font-size: 1.05em;
}

.faq-answer ul {
    margin: 15px 0;
    padding-left: 25px;
}

.faq-answer li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.6;
}

.faq-answer strong {
    color: #333;
    font-weight: 600;
}

/* Footer with Better Spacing */
footer {
    background: #2c3e50;
    color: white;
    padding: 60px 0 30px;
    margin-top: 0;
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.footer-section h4 {
    color: #bdc3c7;
    margin-bottom: 20px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.footer-section a:hover {
    color: #667eea;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 30px;
    text-align: center;
    color: #95a5a6;
}

/* Responsive FAQ */
@media (max-width: 768px) {
    .faq-section {
        padding: 50px 0;
    }
    
    .faq-header {
        margin-bottom: 40px;
    }
    
    .faq-header h2 {
        font-size: 2em;
    }
    
    .faq-item {
        padding: 30px 25px;
    }
    
    .faq-item h3 {
        font-size: 1.2em;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .faq-section {
        padding: 40px 0;
    }
    
    .faq-header h2 {
        font-size: 1.8em;
    }
    
    .faq-item {
        padding: 25px 20px;
    }
    
    .faq-item h3 {
        font-size: 1.1em;
    }
}

/* Animation for FAQ items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item {
    animation: fadeInUp 0.6s ease-out;
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }
.faq-item:nth-child(6) { animation-delay: 0.6s; }
.faq-item:nth-child(7) { animation-delay: 0.7s; }