/* BizSherlock - Premium Cyber Detective CSS */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-base: #07090e;
    --bg-surface: rgba(16, 20, 30, 0.6);
    --bg-card: rgba(22, 28, 45, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-accent: #f59e0b; /* Amber/Gold for detective vibe */
    --color-accent-rgb: 245, 158, 11;
    --color-purple: #8b5cf6;
    --color-purple-rgb: 139, 92, 246;
    
    --color-red: #ef4444; /* Neon Red for Cap/Fuffa */
    --color-red-glow: rgba(239, 68, 68, 0.4);
    --color-green: #10b981; /* Neon Green for Truths */
    --color-green-glow: rgba(16, 185, 129, 0.4);
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

header {
    width: 100%;
    max-width: 800px;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-text {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--color-purple) 30%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.3));
}

.logo-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
}

header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 400;
}

main {
    width: 100%;
    max-width: 800px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.language-selector-container {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.language-selector-container:hover {
    border-color: var(--color-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

.language-selector-container i {
    color: var(--color-purple);
}

.select-language {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding-right: 0.25rem;
}

.select-language option {
    background: #0f121d;
    color: var(--text-primary);
}

/* Form Styles */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media(min-width: 640px) {
    .search-container {
        flex-direction: row;
    }
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-wrapper i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.input-url {
    width: 100%;
    background: rgba(7, 9, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 1.1rem 1.25rem 1.1rem 3rem;
    border-radius: 16px;
    font-size: 1.05rem;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition-smooth);
}

.input-url:focus {
    border-color: var(--color-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.input-url:focus + i {
    color: var(--color-purple);
}

.btn-scan {
    background: linear-gradient(135deg, var(--color-purple) 0%, #7c3aed 100%);
    color: white;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1.1rem 2rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #9061f9 0%, #8b5cf6 100%);
}

.btn-scan:active {
    transform: translateY(0);
}

/* Loading State */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
    text-align: center;
}

.spinner-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--color-purple);
    border-bottom-color: var(--color-purple);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-inner {
    position: absolute;
    width: 70%;
    height: 70%;
    border: 3px solid transparent;
    border-left-color: var(--color-accent);
    border-right-color: var(--color-accent);
    border-radius: 50%;
    animation: spin-reverse 1s linear infinite;
}

.detective-glass {
    font-size: 1.5rem;
    color: var(--text-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    font-family: var(--font-mono);
    min-height: 1.5rem;
}

/* Results Dashboard */
.results-dashboard {
    display: none;
    margin-top: 3rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin-bottom: 2.5rem;
}

/* Gauge Component */
.gauge-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media(min-width: 640px) {
    .gauge-section {
        flex-direction: row;
        text-align: left;
        justify-content: space-around;
        gap: 2rem;
    }
}

.gauge-chart {
    position: relative;
    width: 160px;
    height: 160px;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283; /* 2 * pi * r (r=45) */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-value-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    font-family: var(--font-mono);
}

.gauge-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-top: 2px;
}

.gauge-info {
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 1rem;
}

@media(min-width: 640px) {
    .gauge-info {
        margin-top: 0;
    }
}

.gauge-info h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.gauge-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Two-column layout for flags/truths */
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media(min-width: 640px) {
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.details-card {
    border-radius: 20px;
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-redflags {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.15);
}

.card-truths {
    background: rgba(16, 185, 129, 0.03);
    border-color: rgba(16, 185, 129, 0.15);
}

.details-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-redflags h3 {
    color: #fca5a5;
}

.card-truths h3 {
    color: #a7f3d0;
}

.details-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.details-list li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.card-redflags .details-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: var(--color-red);
    font-weight: bold;
}

.card-truths .details-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-green);
    font-weight: bold;
}

/* Verdict Section & Avatar */
.verdict-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
}

.verdict-tag {
    position: absolute;
    top: -12px;
    left: 1.5rem;
    background: var(--color-purple);
    color: white;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
}

.avatar-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media(min-width: 640px) {
    .avatar-container {
        grid-template-columns: 1fr 1fr;
    }
}

.detective-block {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.video-block {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    background: #000;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.thumbnail-wrapper:hover {
    border-color: var(--color-purple);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.3);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-title-text {
    margin-top: 1.25rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-primary);
    text-align: left;
    font-family: var(--font-sans);
}

.avatar-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    background: #000;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.avatar-wrapper:hover {
    border-color: var(--color-purple);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.3);
}

.avatar-img, .avatar-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-video {
    display: none;
}

.avatar-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 9, 14, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.avatar-loader.active {
    opacity: 1;
    pointer-events: auto;
}

.voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 25px;
    margin-bottom: 8px;
}

.voice-wave span {
    display: block;
    width: 3px;
    height: 8px;
    background: var(--color-purple);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-delay: 0.15s; }
.voice-wave span:nth-child(3) { animation-delay: 0.3s; }
.voice-wave span:nth-child(4) { animation-delay: 0.45s; }
.voice-wave span:nth-child(5) { animation-delay: 0.6s; }

@keyframes wave {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

.avatar-loader p {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    line-height: 1.2;
}

.verdict-content {
    flex: 1;
}

.verdict-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.verdict-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Voice Visualizer Container (placed below the image wrapper) */
.voice-visualizer-container {
    width: 100%;
    max-width: 640px;
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: rgba(16, 20, 30, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.voice-wave-active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
}

.voice-wave-active span {
    display: block;
    width: 4px;
    height: 6px;
    background: linear-gradient(to top, var(--color-purple), var(--color-accent));
    border-radius: 2px;
    animation: wave-active 1.2s ease-in-out infinite;
}

.voice-wave-active span:nth-child(1) { animation-delay: 0.1s; height: 10px; }
.voice-wave-active span:nth-child(2) { animation-delay: 0.25s; height: 15px; }
.voice-wave-active span:nth-child(3) { animation-delay: 0.4s; height: 8px; }
.voice-wave-active span:nth-child(4) { animation-delay: 0.15s; height: 12px; }
.voice-wave-active span:nth-child(5) { animation-delay: 0.3s; height: 20px; }
.voice-wave-active span:nth-child(6) { animation-delay: 0.2s; height: 14px; }
.voice-wave-active span:nth-child(7) { animation-delay: 0.35s; height: 9px; }
.voice-wave-active span:nth-child(8) { animation-delay: 0.05s; height: 18px; }
.voice-wave-active span:nth-child(9) { animation-delay: 0.45s; height: 11px; }
.voice-wave-active span:nth-child(10) { animation-delay: 0.1s; height: 16px; }
.voice-wave-active span:nth-child(11) { animation-delay: 0.3s; height: 7px; }
.voice-wave-active span:nth-child(12) { animation-delay: 0.25s; height: 13px; }
.voice-wave-active span:nth-child(13) { animation-delay: 0.4s; height: 19px; }
.voice-wave-active span:nth-child(14) { animation-delay: 0.15s; height: 10px; }
.voice-wave-active span:nth-child(15) { animation-delay: 0.2s; height: 15px; }

@keyframes wave-active {
    0%, 100% { height: 6px; transform: scaleY(1); }
    50% { height: 26px; transform: scaleY(1.3); }
}

/* Audio Controls Styling */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.control-btn {
    background: rgba(7, 9, 14, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.control-btn:hover {
    border-color: var(--color-purple);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.control-btn i {
    color: var(--color-purple);
}

#playPauseBtn {
    background: var(--color-purple);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#playPauseBtn:hover {
    background: #7c3aed;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

#playPauseBtn i {
    color: white;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
