/**
 * Image Converter - WordPress Plugin Styles
 * Modern, app-like UI for image format conversion
 */

.image-converter-tool {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.ic-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.ic-header {
    background: transparent;
    padding: 0 0 1.5rem 0;
    color: inherit;
}

.ic-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 400;
    background: linear-gradient(to right, #4f46e5, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.ic-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.5;
}

.ic-body {
    padding: 0;
}

/* Upload Section */
.upload-section {
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.has-image {
    padding: 0;
    border: 1px solid #e5e7eb;
    background: white;
}

.file-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    cursor: pointer;
    z-index: 2;
    font-size: 0;
    margin: 0;
    padding: 0;
}

.upload-area:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.upload-area.dragover {
    border-color: #4f46e5;
    background: #f5f3ff;
    border-style: dashed;
}

.upload-content {
    pointer-events: none;
    width: 100%;
}

.upload-content.hidden {
    display: none;
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.upload-area p {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.upload-area small {
    font-size: 0.875rem;
    color: #718096;
}

/* Image Preview in Upload Area */
.image-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-preview-container.hidden {
    display: none;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 0.5rem;
    object-fit: contain;
    box-shadow: none;
    display: block;
    margin-bottom: 0.5rem;
}

.remove-image-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: none;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.remove-image-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.remove-image-btn span {
    line-height: 1;
    display: block;
    margin: 0;
    padding: 0;
}

.preview-info {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #718096;
    text-align: center;
}

/* Format Selector */
.format-selector {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.format-group {
    flex: 1;
    min-width: 150px;
}

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

.format-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s;
}

.format-select:hover {
    border-color: #9ca3af;
}

.format-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: none;
}

.format-select:disabled {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

.format-display {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    background: #f3f4f6;
    color: #2d3748;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 2.5rem;
}

.format-display span {
    display: block;
    width: 100%;
}

.format-arrow {
    font-size: 1.5rem;
    color: #4f46e5;
    font-weight: 700;
    padding-bottom: 0.5rem;
}

/* Quality Options */
.quality-options {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 0.5rem;
}

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

#quality-slider {
    width: 100%;
    margin-bottom: 0.5rem;
}

.quality-options small {
    font-size: 0.75rem;
    color: #718096;
}

#quality-value {
    color: #4f46e5;
    font-weight: 700;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.convert-btn,
.clear-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.convert-btn:hover:not(:disabled)::before {
    left: 100%;
}

.convert-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.convert-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: none;
    transform: none;
}

.convert-icon {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    display: inline-block;
    margin-right: 0.25rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.clear-btn {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.clear-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.clear-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.clear-btn.hidden {
    display: none;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #fafafa;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.loading-state.hidden {
    display: none;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.loading-state small {
    font-size: 0.875rem;
    color: #718096;
}

/* Results Section */
.results-section {
    margin-top: 1.5rem;
}

.results-section.hidden {
    display: none;
}

.comparison-view {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.image-preview {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 280px;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.image-preview h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #4a5568;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}

.file-info {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.5rem;
}

/* Download Section */
.download-section {
    text-align: center;
    margin-top: 1.5rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 0.75rem;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    text-decoration: none !important;
    color: white;
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.download-icon {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    display: inline-block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Error State */
.error-state {
    background: #fff0f0;
    border: 1px solid #e53e3e;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: #c53030;
    margin-top: 1.5rem;
}

.error-state.hidden {
    display: none;
}

.format-selector.hidden {
    display: none !important;
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.error-state p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
    .comparison-view {
        flex-direction: column;
        gap: 1rem;
    }
    
    .image-preview {
        flex: 1 1 100%;
        min-width: unset;
    }
    
    .format-selector {
        flex-direction: column;
    }
    
    .format-arrow {
        transform: rotate(90deg);
        text-align: center;
        padding: 0.5rem 0;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

