/**
 * Light Mode Button Fix and Animation Trigger Improvements
 */

/* Fix for light mode button text readability - COMPREHENSIVE FIX */
[data-theme="light"] .btn-secondary,
[data-theme="light"] a.btn-secondary,
[data-theme="light"] button.btn-secondary,
[data-theme="light"] .product-actions .btn-secondary,
[data-theme="light"] .product-card .btn-secondary {
    background: rgba(71, 85, 105, 0.1) !important;
    color: #334155 !important; /* Dark text for light mode */
    border: 1px solid rgba(71, 85, 105, 0.2) !important;
    font-weight: 600 !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] a.btn-secondary:hover,
[data-theme="light"] button.btn-secondary:hover,
[data-theme="light"] .product-actions .btn-secondary:hover,
[data-theme="light"] .product-card .btn-secondary:hover {
    background: rgba(71, 85, 105, 0.2) !important;
    color: #1e293b !important; /* Even darker on hover */
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
}

/* Additional specificity for any missed secondary buttons */
[data-theme="light"] *[class*="btn-secondary"] {
    color: #334155 !important;
}

[data-theme="light"] *[class*="btn-secondary"]:hover {
    color: #1e293b !important;
}

/* Ensure primary button also looks good in light mode */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    border: none !important;
}

[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, #5b5bf6 0%, #7c3aed 100%) !important;
    transform: translateY(-2px) !important;
}

/* Product action buttons container enhancement */
.product-actions {
    display: flex !important;
    gap: 12px !important;
    margin-top: 20px !important;
    align-items: center !important;
}

/* Better visibility for all buttons */
.product-actions .btn-primary,
.product-actions .btn-secondary {
    padding: 12px 24px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 120px !important;
    text-align: center !important;
}

/* Dark mode (default) button styles */
[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* COMPREHENSIVE BUTTON TEXT COLOR FIXES FOR LIGHT MODE */

/* Fix for CTA buttons and any other secondary button variants */
[data-theme="light"] .cta-button.secondary,
[data-theme="light"] .cta-button[class*="secondary"] {
    background: rgba(71, 85, 105, 0.1) !important;
    color: #334155 !important;
    border: 1px solid rgba(71, 85, 105, 0.2) !important;
}

[data-theme="light"] .cta-button.secondary:hover,
[data-theme="light"] .cta-button[class*="secondary"]:hover {
    background: rgba(71, 85, 105, 0.2) !important;
    color: #1e293b !important;
    border: 1px solid rgba(71, 85, 105, 0.3) !important;
}

/* Fix for any button with "View Plans", "Contact Sales", etc. text */
[data-theme="light"] a[href*="pricing"].btn-secondary,
[data-theme="light"] a[href*="contact"].btn-secondary,
[data-theme="light"] a[href*="sales"].btn-secondary {
    color: #334155 !important;
    background: rgba(71, 85, 105, 0.1) !important;
}

[data-theme="light"] a[href*="pricing"].btn-secondary:hover,
[data-theme="light"] a[href*="contact"].btn-secondary:hover,
[data-theme="light"] a[href*="sales"].btn-secondary:hover {
    color: #1e293b !important;
    background: rgba(71, 85, 105, 0.2) !important;
}

/* Universal override for any white text on buttons in light mode */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-secondary *,
[data-theme="light"] a.btn-secondary,
[data-theme="light"] a.btn-secondary * {
    color: #334155 !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .btn-secondary:hover *,
[data-theme="light"] a.btn-secondary:hover,
[data-theme="light"] a.btn-secondary:hover * {
    color: #1e293b !important;
}

/* Override any CSS variables that might be causing white text */
[data-theme="light"] {
    --btn-secondary-color: #334155 !important;
    --btn-secondary-hover-color: #1e293b !important;
}

/* Force override any problematic color values */
[data-theme="light"] .btn-secondary {
    color: #334155 !important;
}

[data-theme="light"] .btn-secondary:visited {
    color: #334155 !important;
}

[data-theme="light"] .btn-secondary:active {
    color: #1e293b !important;
}

/* Specific product card button fixes */
[data-theme="light"] .product-card .btn-secondary,
[data-theme="light"] .showcase-card .btn-secondary,
[data-theme="light"] .service-card .btn-secondary {
    color: #334155 !important;
    background: rgba(71, 85, 105, 0.1) !important;
}

/* Final catch-all for any missed secondary buttons */
[data-theme="light"] button[class*="secondary"],
[data-theme="light"] a[class*="secondary"],
[data-theme="light"] .btn[class*="secondary"],
[data-theme="light"] *[class*="btn-secondary"] {
    color: #334155 !important;
}

[data-theme="light"] button[class*="secondary"]:hover,
[data-theme="light"] a[class*="secondary"]:hover,
[data-theme="light"] .btn[class*="secondary"]:hover,
[data-theme="light"] *[class*="btn-secondary"]:hover {
    color: #1e293b !important;
}

/* Force animations to be more visible and dynamic */
.animated-placeholder {
    min-height: 300px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
}

[data-theme="light"] .animated-placeholder {
    background: rgba(0, 0, 0, 0.03) !important;
}

/* Ensure animations start immediately when visible */
.animation-element {
    animation-play-state: running !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force animation containers to be fully visible */
.operator-animation-container,
.coder-animation-container,
.llm-animation-container,
.app-animation-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 280px !important;
    position: relative !important;
    display: block !important;
}

/* Animation refresh trigger */
.animated-placeholder.force-refresh {
    animation: refreshPulse 0.3s ease-in-out !important;
}

@keyframes refreshPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
