/* Beta Theme Styles - Based on result-design-1.html */
.beta-theme {
    --primary-gradient: none;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent-blue: #667eea;
    --accent-purple: #764ba2;
    --accent-pink: #4facfe;
}

/* CRITICAL: Override all body backgrounds aggressively */
html.beta-theme,
html.beta-theme body,
.beta-theme body {
    background: #0f0f1a !important;
    transition: background 0.6s ease, color 0.6s ease;
}

/* Hide or override the animated-bg element used in modern-styles.css */
.beta-theme .animated-bg,
.beta-theme .floating-shapes {
    display: none !important;
}

/* Dynamic gradient background for beta theme */
.beta-theme body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.15) 0%, transparent 50%);
    filter: blur(80px);
    animation: betaGradientShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

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

/* Subtle grid for beta theme */
.beta-theme body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content is above background */
.beta-theme .nav,
.beta-theme .hero,
.beta-theme .features,
.beta-theme .showcase,
.beta-theme .pricing,
.beta-theme .footer {
    position: relative;
    z-index: 1;
}

/* Beta theme cards - Aggressive overrides for all card types */
.beta-theme .feature-card,
.beta-theme .pricing-card,
.beta-theme .stat-item,
.beta-theme .showcase-visual,
.beta-theme .card,
.beta-theme .glass-card,
.beta-theme .main-card {
    background: rgba(25, 25, 40, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.beta-theme .feature-card:hover,
.beta-theme .pricing-card:hover,
.beta-theme .stat-item:hover {
    transform: translateY(-8px);
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3) !important;
    background: rgba(25, 25, 40, 0.9) !important;
}

/* Beta theme navigation - consolidated */
.beta-theme .nav,
.beta-theme .navbar {
    background: rgba(25, 25, 40, 0.7) !important;
    backdrop-filter: blur(30px) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15) !important;
}

.beta-theme .nav.scrolled,
.beta-theme .navbar.scrolled {
    background: rgba(25, 25, 40, 0.85) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.25) !important;
}

/* Beta theme buttons */
.beta-theme .btn-primary,
.beta-theme .plan-cta.primary {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3) !important;
}

.beta-theme .btn-primary:hover,
.beta-theme .plan-cta.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4) !important;
}

.beta-theme .btn-secondary,
.beta-theme .plan-cta.secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 2px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.beta-theme .btn-secondary:hover,
.beta-theme .plan-cta.secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    transform: translateY(-3px);
}

/* Beta theme sections */
.beta-theme .features,
.beta-theme .pricing {
    background: rgba(0, 0, 0, 0.2) !important;
}

.beta-theme .showcase {
    background: rgba(0, 0, 0, 0.15) !important;
}

.beta-theme .footer {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Beta theme gradient text */
.beta-theme h1,
.beta-theme .stat-number,
.beta-theme .page-title {
    background: linear-gradient(135deg, #667eea, #4facfe) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Beta theme text colors - Override default colors */
.beta-theme h2,
.beta-theme h3,
.beta-theme .section-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

.beta-theme p,
.beta-theme .page-subtitle {
    color: rgba(255, 255, 255, 0.75) !important;
}

.beta-theme label,
.beta-theme .form-group label {
    color: rgba(255, 255, 255, 0.85) !important;
}

.beta-theme .logo {
    color: white !important;
}

/* Beta theme form elements - Ensure visibility */
.beta-theme .form-control,
.beta-theme input,
.beta-theme select,
.beta-theme textarea {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.beta-theme .form-control:focus,
.beta-theme input:focus,
.beta-theme select:focus,
.beta-theme textarea:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: white !important;
}

.beta-theme .form-control::placeholder,
.beta-theme input::placeholder,
.beta-theme textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.beta-theme .result-card-content,
.beta-theme .result-card,
.beta-theme .upload-text,
.beta-theme .upload-hint {
    color: rgba(255, 255, 255, 0.9) !important;
}

.beta-theme .upload-area {
    background: rgba(102, 126, 234, 0.08) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

/* Override specific element text colors that might be hardcoded */
.beta-theme .loading-text {
    color: #667eea !important;
}

/* Beta theme chat and messaging elements */
.beta-theme #chatMessages {
    background: rgba(25, 25, 40, 0.6) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.beta-theme #chatMessages > div {
    background: rgba(255, 255, 255, 0.08) !important;
    border-left-color: rgba(102, 126, 234, 0.8) !important;
}

.beta-theme #chatMessages strong {
    color: #667eea !important;
}

.beta-theme #chatMessages div[style*="color: #333"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

.beta-theme #typingIndicator {
    color: rgba(102, 126, 234, 0.9) !important;
}

/* Beta theme message input area */
.beta-theme #messageInput {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Beta theme for AI tutor chat messages */
.beta-theme .chat-container,
.beta-theme .messages-container {
    background: rgba(25, 25, 40, 0.6) !important;
}

.beta-theme .message {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.beta-theme .message.user {
    background: rgba(102, 126, 234, 0.2) !important;
}

.beta-theme .message.ai {
    background: rgba(139, 92, 246, 0.15) !important;
}

/* Beta theme result cards and output areas */
.beta-theme .result-section,
.beta-theme #result,
.beta-theme #output,
.beta-theme #predictionResult {
    background: rgba(25, 25, 40, 0.7) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.beta-theme .result-section h3,
.beta-theme .result-section h4,
.beta-theme #result h3,
.beta-theme #result h4 {
    color: rgba(255, 255, 255, 0.95) !important;
}

.beta-theme .result-section p,
.beta-theme .result-section div,
.beta-theme #result p,
.beta-theme #result div {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Beta theme headers and titles */
.beta-theme .header h1,
.beta-theme .header p {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Beta theme badges and labels */
.beta-theme .pro-badge,
.beta-theme .badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
}

/* Beta theme small text and hints */
.beta-theme small {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Beta theme for specific inline styled elements */
.beta-theme [style*="color: #333"],
.beta-theme [style*="color: #666"],
.beta-theme [style*="color: #555"],
.beta-theme [style*="color: #1f2937"],
.beta-theme [style*="color: #374151"],
.beta-theme [style*="color: #6b7280"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

.beta-theme [style*="color: #94a3b8"] {
    color: rgba(255, 255, 255, 0.6) !important;
}

.beta-theme [style*="background: #f8f9fa"],
.beta-theme [style*="background: #fff"],
.beta-theme [style*="background: white"],
.beta-theme [style*="background: rgba(255, 255, 255, 0.95)"],
.beta-theme [style*="background: rgba(255, 255, 255, 0.9)"],
.beta-theme [style*="background: rgba(255, 255, 255, 0.8)"] {
    background: rgba(25, 25, 40, 0.6) !important;
}

/* Beta theme for live-analyzer specific elements */
.beta-theme .container {
    background: rgba(25, 25, 40, 0.85) !important;
}

.beta-theme .camera-container,
.beta-theme .result-container {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

.beta-theme .camera-title,
.beta-theme .result-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

.beta-theme .camera-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
}

.beta-theme .captured-image {
    border: 2px solid rgba(102, 126, 234, 0.3) !important;
}

/* Beta theme for result content */
.beta-theme .result-content,
.beta-theme .result-text {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Beta theme for secondary buttons */
.beta-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.beta-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Beta theme for code blocks and documentation */
.beta-theme pre {
    background: rgba(0, 0, 0, 0.4) !important;
    border-left-color: rgba(102, 126, 234, 0.6) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

.beta-theme code {
    color: rgba(255, 255, 255, 0.95) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 2px 6px;
    border-radius: 4px;
}

.beta-theme pre code {
    background: transparent !important;
    padding: 0 !important;
}

/* Beta theme for lists */
.beta-theme ol,
.beta-theme ul {
    color: rgba(255, 255, 255, 0.85) !important;
}

.beta-theme li {
    color: rgba(255, 255, 255, 0.85) !important;
}

.beta-theme strong {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Theme toggle button styles */
#theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Classic theme button */
body:not(.beta-theme) #theme-toggle-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

body:not(.beta-theme) #theme-toggle-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

/* Beta theme button */
.beta-theme #theme-toggle-btn {
    background: linear-gradient(135deg, #667eea, #4facfe);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.beta-theme #theme-toggle-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.6);
}

#theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    #theme-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}
