/* File Compressor Frontend Styles */

.wp-file-compressor-frontend {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.compressor-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Tab Navigation */
.compression-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: #0073aa;
    background: #f8f9fa;
}

.tab-button.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #f8f9fa;
}

.tab-button .icon {
    font-size: 18px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.compression-section {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Upload Area */
.upload-area {
    margin-bottom: 30px;
}

.upload-drop-zone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-drop-zone:hover,
.upload-drop-zone.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.upload-drop-zone h4 {
    color: #333;
    margin: 15px 0 10px 0;
    font-size: 20px;
}

.upload-drop-zone p {
    color: #666;
    margin: 10px 0;
    font-size: 16px;
}

.upload-info {
    font-size: 14px !important;
    color: #999 !important;
}

.upload-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 15px;
}

.upload-button:hover {
    background: #005a87;
}

/* Compression Settings */
.compression-settings {
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.compression-settings h4 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.settings-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.setting-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.quality-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e1e1e1;
    outline: none;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
}

.quality-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    border: none;
}

.compress-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.compress-button:hover {
    background: #005a87;
}

/* File List */
.file-list {
    margin-bottom: 30px;
}

.file-list h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.files-container {
    display: grid;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.file-icon {
    font-size: 20px;
    color: #666;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.file-size {
    color: #666;
    font-size: 12px;
}

/* Compression Results */
.compression-results {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 25px;
}

.compression-results h4 {
    margin-top: 0;
    color: #0d47a1;
    font-size: 18px;
}

.results-summary {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.results-container {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.result-stats {
    color: #666;
    font-size: 12px;
}

.compression-ratio {
    font-weight: 600;
    color: #2e7d32;
}

.results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-button,
.reset-button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-button {
    background: #2e7d32;
    color: white;
}

.download-button:hover {
    background: #1b5e20;
}

.reset-button {
    background: #666;
    color: white;
}

.reset-button:hover {
    background: #555;
}

/* Progress Indicator */
.compression-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 300px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-file-compressor-frontend {
        padding: 15px;
    }
    
    .compression-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-button {
        text-align: center;
        border-bottom: 1px solid #e1e1e1;
        border-radius: 6px;
        margin-bottom: 5px;
    }
    
    .tab-button.active {
        border-bottom-color: #0073aa;
        background: #0073aa;
        color: white;
    }
    
    .compression-section {
        padding: 20px;
    }
    
    .upload-drop-zone {
        padding: 30px 20px;
    }
    
    .settings-grid {
        gap: 15px;
    }
    
    .file-item,
    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .download-button,
    .reset-button {
        flex: none;
        width: 100%;
    }
    
    .compression-progress {
        left: 15px;
        right: 15px;
        transform: translateY(-50%);
        min-width: auto;
    }
}

/* Error and Success Messages */
.compressor-error {
    background: #fff2f2;
    border: 1px solid #ff6b6b;
    border-radius: 6px;
    padding: 15px;
    color: #d63031;
    margin: 15px 0;
    text-align: center;
}

.compressor-success {
    background: #f0fff4;
    border: 1px solid #00b894;
    border-radius: 6px;
    padding: 15px;
    color: #00b894;
    margin: 15px 0;
    text-align: center;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.button.loading {
    position: relative;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hide elements */
.hidden {
    display: none !important;
}