/**
 * Thumbnail Analyzer Styles
 * Matches Mixtooly design system
 */

/* --- CRITICAL FIX: Wrapper Layout --- */
.thumbnail-analyzer-wrapper {
    /* Force auto height to remove extra space */
    min-height: 0 !important; 
    height: auto !important;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 48px 16px;
    padding-bottom: 48px;
    box-sizing: border-box;
}

.thumbnail-analyzer-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Header Styles */
.ta-header {
    text-align: center;
    margin-bottom: 48px;
}

.ta-title {
    font-family: 'Poppins', sans-serif;
    font-size: 55px;
    line-height: 60px;
    font-weight: 700;
    color: #0F1729;
    margin: 0 0 16px 0;
}

.ta-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    line-height: 28px;
    font-weight: 400;
    color: #6B7280;
    margin: 0;
}

/* Grid Layout */
.ta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .ta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Upload Box */
.ta-upload-box {
    width: 100%;
}

.ta-upload-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

/* Dropzone */
.ta-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px;
    background: #ffffff;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ta-dropzone:hover {
    border-color: #fb923c;
}

.ta-dropzone.dragover {
    border-color: #fb923c;
    background: #fff7ed;
}

.ta-dropzone-content {
    text-align: center;
    width: 100%;
}

.ta-upload-icon {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin: 0 auto 16px;
    display: block;
}

.ta-dropzone-text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Preview */
.ta-preview {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ta-preview img {
    width: 100%;
    height: auto;
    max-height: 400px; /* Limit height to prevent massive images */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- CRITICAL FIX: Remove Button (X Icon) --- */
.ta-remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    /* Dark semi-transparent background instead of Red */
    background-color: rgba(17, 24, 39, 0.75) !important; 
    /* Rounded Square instead of Circle */
    border-radius: 6px !important; 
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
    padding: 0;
    backdrop-filter: blur(4px);
}

.ta-remove-btn:hover {
    background-color: #fb923c !important; /* Orange on hover */
    transform: scale(1.05);
}

.ta-remove-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #ffffff !important; /* Ensure X is white */
    stroke-width: 2.5;
}

/* Action Buttons */
.ta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 0;
}

.ta-btn {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ta-btn-primary {
    background: #fb923c;
    color: white;
}

.ta-btn-primary:hover:not(:disabled) {
    background: #f97316;
}

.ta-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ta-btn-secondary {
    background: #1f2937;
    color: white;
}

.ta-btn-secondary:hover {
    background: #111827;
}

/* Spinner */
.ta-spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.ta-results-section {
    animation: fadeIn 0.5s ease;
    margin-top: 32px; /* Add spacing above results */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ta-results-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 32px;
    margin-bottom: 32px;
}

/* Winner Header */
.ta-winner-header {
    text-align: center;
    margin-bottom: 32px;
}

.ta-winner-title {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.ta-winner-reason {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 28px;
    color: #6b7280;
    margin: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Comparison Grid */
.ta-comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .ta-comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Result Card */
.ta-result-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.ta-result-card.winner {
    border: 4px solid #fb923c;
    box-shadow: 0 0 20px rgba(251, 146, 60, 0.3);
}

.ta-result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.ta-result-image {
    margin-bottom: 24px;
}

.ta-result-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Metrics */
.ta-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ta-metric {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ta-metric-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    min-width: 120px;
}

.ta-metric-bar-container {
    flex: 1;
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.ta-metric-bar {
    height: 100%;
    background: #fb923c;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ta-metric-value {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    min-width: 48px;
    text-align: right;
}

/* Suggestions */
.ta-suggestions {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
}

.ta-suggestions-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0F1729;
    margin: 0 0 16px 0;
}

.ta-suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ta-suggestions-list li {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #6b7280;
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.ta-suggestions-list li:before {
    content: "•";
    color: #fb923c;
    font-size: 20px;
    position: absolute;
    left: 0;
}

/* Error Message */
.ta-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 767px) {
    .ta-title {
        font-size: 36px;
        line-height: 42px;
    }
    
    .ta-subtitle {
        font-size: 16px;
        line-height: 24px;
    }
    
    .ta-winner-title {
        font-size: 28px;
    }
    
    .thumbnail-analyzer-wrapper {
        padding: 24px 16px;
    }
    
    .ta-results-container {
        padding: 20px;
    }
}