/* css/compressor.css - Enhanced with SEO Section Styles */

/* --- Page Wrapper --- */
.compressor-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* --- Fullscreen Tool Container --- */
.tool-fullscreen-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 60px));
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

.tool-header-main {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.tool-page-title {
    font-family: var(--font-headings);
    font-size: clamp(2.0rem, 5vw, 2.8rem);
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 0.3rem;
}
.tool-page-description {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Compressor Tool Interface --- */
.compressor-tool-interface {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    box-shadow: var(--shadow-main-medium);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    flex-grow: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
}

.compressor-settings-panel {
    background-color: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-main);
    flex-shrink: 0;
}
.tabs-nav {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-main);
}
.tab-link {
    background: none; border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    font-size: 0.9rem; font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    margin-bottom: -1px;
}
.tab-link.active, .tab-link[aria-selected="true"] {
    color: var(--accent-main);
    border-bottom-color: var(--accent-main);
    font-weight: 600;
}
.tab-link:hover:not(.active) { color: var(--text-main); }
.tab-content-wrapper .tab-content-pane { display: none; }
.tab-content-wrapper .tab-content-pane.active { display: block; }
.setting-label {
    display: block;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.slider-ui-group, .size-input-ui-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.comp-slider {
    flex-grow: 1;
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px;
    background: var(--border-main);
    border-radius: 3px; outline: none; cursor: pointer;
}
.comp-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px;
    background: var(--accent-main);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}
.comp-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    background: var(--accent-main);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
    cursor: pointer;
}
.slider-value {
    font-size: 0.9rem; color: var(--text-main);
    background-color: var(--bg-main);
    padding: 0.3rem 0.6rem; border-radius: 4px;
    min-width: 40px; text-align: center;
    border: 1px solid var(--border-subtle);
}
.comp-input, .comp-select {
    background-color: var(--bg-main);
    border: 1px solid var(--border-main);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    font-size: 0.9rem;
}
.comp-input-number { width: 70px; }
.comp-input:focus, .comp-select:focus {
    outline: none;
    border-color: var(--accent-main);
    box-shadow: 0 0 0 2px rgba(var(--accent-main-rgb), 0.3);
}
.setting-hint {
    display: block;
    font-size: 0.75rem; color: var(--text-secondary);
    opacity: 0.8; margin-top: 0.3rem;
}
.compressor-file-dropzone {
    border: 2px dashed var(--border-main);
    border-radius: 8px;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    flex-grow: 1;
    min-height: 150px;
    overflow: hidden;
}
.compressor-file-dropzone.dragover {
    border-color: var(--accent-main);
    background-color: rgba(var(--accent-main-rgb), 0.05);
}
.dropzone-prompt { text-align: center; color: var(--text-secondary); }
.dropzone-icon {
    width: 36px; height: 36px;
    stroke: var(--accent-main);
    margin-bottom: 0.75rem;
}
.dropzone-text-primary { margin-bottom: 0.5rem; font-size: 0.95rem; }
.dropzone-text-primary strong { color: var(--text-main); }
.dropzone-text-divider { font-size: 0.8rem; opacity: 0.7; margin: 0.6rem 0; display: block; }
.dropzone-text-info { font-size: 0.8rem; opacity: 0.7; margin-top: 0.75rem; }
.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 0.25rem;
}
.compressor-file-dropzone.has-files .dropzone-prompt { display: none; }
.compressor-file-dropzone:not(.has-files) .file-preview-grid { display: none; }
.image-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    display: flex; flex-direction: column;
    position: relative;
    font-size: 0.75rem;
    box-shadow: var(--shadow-main-soft);
}

/* Upload More Images Card */
.upload-more-card {
    border: 2px dashed var(--border-main);
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.upload-more-card:hover {
    border-color: var(--accent-main);
    background-color: rgba(var(--accent-main-rgb), 0.05);
    transform: scale(1.02);
}

.upload-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    height: 100%;
}

.upload-more-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.upload-more-card:hover .upload-more-icon {
    transform: scale(1.1);
}

.upload-more-title {
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    font-size: 0.85rem;
}
.image-card .image-container { aspect-ratio: 4 / 3; background-color: var(--bg-surface); overflow: hidden; }
.image-card img { width: 100%; height: 100%; object-fit: cover; }
.image-card .info-box { padding: 0.5rem; text-align: left; }
.image-card .info-box p { margin-bottom: 0.2rem; line-height: 1.3; }
.image-card .info-box .filename {
    font-weight: 600; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
    font-size: 0.9em;
}
.image-card .info-box .size-info { color: var(--text-secondary); font-size: 0.85em; }
.image-card .info-box .status {
    font-weight: 500; display: inline-block;
    padding: 1px 5px; border-radius: 3px;
    font-size: 0.8em; margin-top: 0.2rem;
}
.status.pending { color: #D29922; background-color: rgba(210,153,34,0.1); }
.status.compressed { color: #3FB950; background-color: rgba(63,185,80,0.1); }
.status.compressing { color: var(--accent-main); background-color: rgba(var(--accent-main-rgb),0.1); }
.status.error { color: #F85149; background-color: rgba(248,81,73,0.1); }
.image-card .card-actions { padding: 0 0.5rem 0.5rem; margin-top: auto; }
.btn-download-single {
    width: 100%; font-size: 0.75rem; padding: 0.3rem 0.4rem;
    background-color: var(--accent-secondary); color: white;
}
.btn-download-single:hover { background-color: var(--accent-secondary-hover, #8957e0); }
.btn-download-single:disabled { background-color: var(--border-main); color: var(--text-secondary); opacity: 0.6; }
.delete-image-btn {
    position: absolute; top: 5px; right: 5px;
    background-color: rgba(var(--bg-main-rgb), 0.7);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 50%; width: 20px; height: 20px;
    font-size: 12px; line-height: 18px; text-align: center;
    cursor: pointer; transition: all 0.15s ease; padding:0;
}
.delete-image-btn:hover { background-color: #F85149; color: white; border-color: #F85149; }
.compressor-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-main);
    flex-shrink: 0;
}
.compressor-action-bar .btn { font-size: 0.9rem; padding: 0.6rem 1.2rem; }

.page-content-below-tool {
    flex-shrink: 0;
    background-color: var(--bg-main);
}

/* --- SEO Content Section Styles --- */

/* Target Size Compression Section */
.target-size-compression {
    background: linear-gradient(135deg, rgba(var(--accent-main-rgb), 0.03) 0%, rgba(var(--accent-secondary-rgb), 0.02) 100%);
    border-top: 1px solid var(--border-subtle);
}

/* Batch Processing Benefits Section */
.batch-processing-benefits {
    position: relative;
}

.batch-processing-benefits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-main), var(--accent-secondary));
    border-radius: 1px;
}

/* Privacy Security Section */
.privacy-security {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin: 2rem auto;
    max-width: calc(100% - 2rem);
}

.privacy-security .features-grid > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.privacy-security .features-grid > div:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-main-medium);
}

/* Use Cases Section */
.use-cases {
    position: relative;
    overflow: hidden;
}

.use-cases::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--accent-main-rgb), 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.use-cases .container {
    position: relative;
    z-index: 1;
}

.use-cases > div > div:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease;
}

/* Enhanced FAQ Styles */
.compressor-faq .faq-item {
    transition: all 0.2s ease;
}

.compressor-faq .faq-item:hover {
    background-color: rgba(var(--accent-main-rgb), 0.02);
}

.compressor-faq .faq-question:hover {
    color: var(--accent-main);
}

/* Testimonials Enhancement */
.compressor-testimonials .testimonial-card {
    position: relative;
    overflow: hidden;
}

.compressor-testimonials .testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-main), var(--accent-secondary));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.compressor-testimonials .testimonial-card:hover::before {
    transform: translateX(0);
}

/* Section spacing improvements */
.content-section + .content-section {
    border-top: 1px solid rgba(var(--border-main-rgb), 0.3);
}

.content-section:nth-child(even) {
    background-color: rgba(var(--bg-surface-rgb), 0.3);
}

/* Responsive adjustments */
@media (min-width: 769px) { /* Desktop styles */
    .tool-fullscreen-container {
        padding: 1.5rem 2rem;
        align-items: center;
    }
    .tool-header-main {
        margin-bottom: 1.25rem;
    }
    .compressor-tool-interface {
        width: 100%;
        max-width: 900px;
    }
    
    /* Enhanced desktop spacing for new sections */
    .privacy-security .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-height: 700px), (max-width: 768px) {
    .tool-fullscreen-container {
        height: auto;
        min-height: calc(100vh - var(--header-height, 50px));
        padding: 1rem;
    }
    .tool-header-main {
        margin-bottom: 0.75rem;
        padding: 0 0.75rem;
    }
    .tool-page-title {
        font-size: clamp(1.8rem, 5.5vw, 2.2rem);
        margin-top: 0;
    }
    .compressor-tool-interface { padding: 1rem; gap: 0.75rem; }
    .compressor-settings-panel { padding: 0.75rem; }
    .tabs-nav { margin-bottom: 0.75rem; }
    .tab-link { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
    .compressor-file-dropzone { padding: 0.75rem; min-height: 120px;}
    .dropzone-icon { width: 30px; height: 30px; margin-bottom: 0.5rem; }
    .dropzone-text-primary { font-size: 0.9rem; }

    .file-preview-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem;}
    .image-card { font-size: 0.7rem; }
    .delete-image-btn { width: 18px; height: 18px; font-size: 10px; line-height: 16px; }

    .compressor-action-bar {
        padding-top: 0.75rem;
        justify-content: center;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
    }
    .compressor-action-bar .btn {
        font-size: 0.85rem; 
        padding: 0.5rem 0.75rem;
        min-width: 0;
        white-space: nowrap;
    }
    
    /* Mobile optimizations for new sections */
    .privacy-security .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .privacy-security .features-grid > div {
        padding: 1rem;
    }
    
    .use-cases > div {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .use-cases > div > div {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .tool-page-title { font-size: clamp(1.6rem, 6vw, 2rem); }
    .tool-page-description { font-size: clamp(0.8rem, 2.5vw, 0.85rem); }
    
    /* FIXED: Keep target size input and unit select in one row on mobile */
    .size-input-ui-group { 
        flex-direction: row !important; 
        align-items: center !important; 
        gap: 0.5rem !important; 
    }
    .comp-input-number { 
        width: auto !important; 
        flex: 1;
        min-width: 80px;
    }
    .comp-select {
        width: auto;
        min-width: 60px;
    }
    
    /* FIXED: Slider can stack vertically */
    .slider-ui-group { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 0.5rem; 
    }
    .slider-value { 
        margin-top: 0.25rem; 
        text-align: left; 
        background: none; 
        padding: 0; 
        border: none;
    }
    
    /* FIXED: Put Compress and Download buttons in one row, Clear All below */
    .compressor-action-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        padding-top: 0.75rem;
        justify-content: stretch;
    }
    .compressor-action-bar .btn { 
        font-size: 0.8rem; 
        padding: 0.5rem 0.5rem;
        min-width: 0;
        white-space: nowrap;
    }
    /* Compress button - first row, first column */
    #compressAllButton {
        grid-column: 1;
        grid-row: 1;
    }
    /* Download button - first row, second column */
    #downloadAllButton {
        grid-column: 2;
        grid-row: 1;
    }
    /* Clear All button - second row, spans both columns */
    #clearAllButton {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    
    /* Mobile styles for new sections */
    .privacy-security {
        margin: 1rem;
        max-width: calc(100% - 1rem);
    }
    
    .privacy-security .features-grid > div {
        padding: 1rem;
        text-align: center;
    }
    
    .use-cases > div > div {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .target-size-compression ul,
    .batch-processing-benefits ul {
        padding-left: 0.5rem;
    }
    
    .target-size-compression li,
    .batch-processing-benefits li {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
}