/* /app/static/css/style.css */

/* --- Base & Typography --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212; /* A deep, true black for dark mode */
    color: #e0e0e0; /* Light gray text for better readability */
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
}

/* --- Hero Section --- */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(20, 2, 64, 0.95), rgba(18, 18, 18, 0.95)), url('https://www.transparenttextures.com/patterns/cubes.png');
    background-size: cover, auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero h1 {
    font-weight: 700;
    font-size: 3.5rem;
}

.hero .lead {
    font-weight: 300;
    color: var(--bs-secondary-color);
}

/* --- Upload Box --- */
.upload-box {
    position: relative;
    padding: 1.5rem;
    border: 2px dashed var(--bs-border-color-translucent);
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.upload-box:hover, .upload-box.dragover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--bs-primary);
}

.modal-dialog {
    max-width: 600px;
}

.upload-box i {
    font-size: 3.5rem;
    color: var(--bs-primary);
}

/* Hide the actual file input */
#file-input {
    display: none;
}

/* --- Content Sections --- */
.content-section {
    padding: 5rem 0;
}

/* --- Feature Card --- */
.feature-card {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color-translucent);
    padding: 2rem;
    border-radius: 0.75rem;
    height: 100%;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.25);
}

.feature-card .icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* --- Result Cards (Reusing styles from your initial file, adapted for dark theme) --- */
.result-card {
    background-color: var(--bs-tertiary-bg);
    transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
    border: 1px solid var(--bs-border-color-translucent);
}
.result-card:hover {
    transform: scale(1.03);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.3)!important;
}
.result-card img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top;
}


.query-image {
    max-height: 400px;
    width: auto;
    border: 4px solid var(--bs-border-color);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        padding: 1rem 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .lead {
        font-size: 1rem;
    }

    .query-image {
        max-height: 200px;
    }
}

/* --- Animations --- */
@keyframes scale-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fade-in-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#image-preview-container {
    animation: scale-in 0.3s ease-out forwards;
}

#image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.25);
}

#image-filename {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.result-card-wrapper {
    opacity: 0;
    animation: fade-in-up 0.5s ease-out forwards;
    animation-delay: calc(var(--animation-order) * 100ms);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Comparison Slider Modal --- */
.comparison-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.comparison-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.comparison-slider .comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    resize: horizontal;
}
.comparison-slider .comparison-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

/* Comparison Canvas Poster Styles */
.poster-container {
    width: 600px;
    max-height: 400px;
    padding: 20px;
    font-family: 'Arial', sans-serif;
    text-align: center;
    box-sizing: border-box;
}

.poster-images {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 10px;
}

.poster-image-wrapper {
    flex: 1;
    max-width: 300px;
}

.poster-image-container {
    width: 300px;
    height: 300px; /* 1:1 aspect ratio */
    border: 3px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto 15px;
    position: relative;
    background: #f8f9fa;
}

.poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures proper fitting without distortion */
    object-position: center top; /* Focus on face/top area */
    display: block;
}

.poster-image-wrapper p {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

.poster-container h2 {
    font-size: 36px;
    font-weight: bold;
    margin: 20px 0 10px;
    color: #007bff;
}

/* .similarity-badge {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 500;
} */

.watermark {
    font-size: 13px;
    color: #f8f9fa;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
}
/* Progress Bar Styles */
.progress {
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(45deg, var(--bs-primary), #0056b3);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-size: 30px 30px;
    animation: progress-animation 1s linear infinite;
}

/* @keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
} */

.progress-state {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 40px;
}

.progress-state i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--bs-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.progress-subtext {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    margin-top: 0.5rem;
}

.progress-percentage {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    text-align: center;
    margin-top: 0.5rem;
}



/* Enhanced feedback modal styles */
#feedbackModal .modal-content {
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

#feedbackModal .btn-outline-success,
#feedbackModal .btn-outline-danger {
    transition: all 0.2s ease;
    border-width: 2px;
}

#feedbackModal .btn-outline-success:hover {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    transform: translateY(-1px);
}

#feedbackModal .btn-outline-danger:hover {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    transform: translateY(-1px);
}

#feedbackModal .btn.active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

#feedbackModal .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

#feedbackModal kbd {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.6em;
}

/* Loading state animations */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Success state */
#submit-feedback-and-continue-btn:disabled {
    opacity: 0.8;
}

/* Error state animations */
.is-invalid {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced Results Page Styles */

/* Platform-specific badges */
.platform-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgb(0, 0, 0);
    backdrop-filter: blur(10px);
}

.platform-onlyfans {
    background: linear-gradient(45deg, #00aeef, #0084ff);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-pornhub {
    background: linear-gradient(45deg, #ff9000, #ffb700);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-instagram {
    background: linear-gradient(45deg, #e1306c, #fd1d1d, #fcaf45);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-twitter {
    background: linear-gradient(45deg, #1da1f2, #0d95e8);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-reddit {
    background: linear-gradient(45deg, #ff4500, #ff6314);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-manyvids {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.platform-chaturbate {
    background: linear-gradient(45deg, #d4242a, #e73c7e);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Default platform styling */
.platform-badge:not([class*="platform-"]) {
    background: linear-gradient(45deg, var(--bs-secondary), var(--bs-dark));
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Similarity badge */
.similarity-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Enhanced result cards */
.result-card {
    background-color: var(--bs-tertiary-bg);
    transition: all 0.3s ease;
    border: 1px solid var(--bs-border-color-translucent);
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2) !important;
}

.result-image {
    aspect-ratio: 3/4;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.result-card:hover .result-image {
    transform: scale(1.05);
}

/* Image overlay for name/username */
.image-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover .image-overlay {
    opacity: 1;
}

/* Query image styling improvements */
.query-image {
    max-height: 300px;
    object-fit: cover;
    border: 3px solid var(--bs-border-color);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.query-image:hover {
    transform: scale(1.02);
}

/* Progress bars for match quality */
.progress {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease-in-out;
}

/* Enhanced animation for result cards */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card-wrapper {
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--animation-order) * 0.1s);
}

/* Sticky sidebar improvements */
.sticky-top {
    transition: top 0.3s ease;
}

/* Enhanced card hover states */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: var(--bs-primary);
}

/* Button enhancements */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn:hover {
    transform: none;
    z-index: 2;
}

/* Feedback section styling */
.bg-primary-subtle {
    background: linear-gradient(135deg, 
        rgba(var(--bs-primary-rgb), 0.1), 
        rgba(var(--bs-primary-rgb), 0.05)) !important;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }
    
    .query-image {
        max-height: 150px;
    }
    
    .platform-badge,
    .similarity-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .result-card:hover {
        transform: translateY(-4px);
    }
    
    .sticky-top {
        position: relative !important;
        top: auto !important;
    }
}

/* Loading states */
.result-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.result-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Improved typography */
.card-title {
    font-weight: 600;
    color: var(--bs-body-color);
    line-height: 1.3;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Enhanced focus states for accessibility */
.btn:focus,
.card:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Smooth scrolling for show more functionality */
html {
    scroll-behavior: smooth;
}

/* Custom dropdown styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
}

.dropdown-item:hover {
    background-color: var(--bs-primary);
    color: white;
}

/* No results state styling */
.display-1 {
    opacity: 0.3;
}

/* Badge positioning improvements */
.position-absolute.top-0.start-0 {
    top: 0.75rem !important;
    left: 0.75rem !important;
}

.position-absolute.top-0.end-0 {
    top: 0.75rem !important;
    right: 0.75rem !important;
}
