/* Custom CSS for StayOn BuyHost - Modern Professional Design */

/* Theme Variables - Professional Color System */
:root {
    /* Dark Theme - Professional Tech */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --accent-hover: #60a5fa;
    --border-color: #334155;
    --header-bg: #0f172a;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Light Theme - Clean Modern */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #2563eb;
    --accent-secondary: #1d4ed8;
    --accent-hover: #3b82f6;
    --border-color: #e2e8f0;
    --header-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-border: #e5e7eb;
}

/* Apply theme variables */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header styles */
header {
    background-color: var(--header-bg) !important;
    border-bottom-color: var(--border-color) !important;
}

/* Navigation links */
nav a {
    color: var(--text-secondary) !important;
}

nav a:hover {
    color: var(--accent-primary) !important;
}

nav a.text-cyan-400 {
    color: var(--accent-primary) !important;
}

/* Mobile menu */
#mobileMenu {
    background-color: var(--header-bg) !important;
}

/* Hero section */
#home {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%) !important;
}

/* Section backgrounds */
section {
    background-color: var(--bg-secondary) !important;
}

/* Card styles */
.bg-gray-800, .bg-gray-900 {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.bg-white {
    background-color: var(--bg-card) !important;
}

/* Text colors */
.text-white {
    color: var(--text-primary) !important;
}

.text-gray-300, .text-gray-400 {
    color: var(--text-secondary) !important;
}

.text-gray-500 {
    color: var(--text-muted) !important;
}

.text-gray-600 {
    color: var(--text-secondary) !important;
}

.text-gray-800 {
    color: var(--text-primary) !important;
}

.text-white span, 
.text-white p,
.text-white h1, 
.text-white h2, 
.text-white h3, 
.text-white h4, 
.text-white h5, 
.text-white h6,
.text-white li,
.text-white div {
    color: inherit !important;
}

.bg-gray-800 .text-white,
.bg-gray-900 .text-white,
.bg-white .text-white,
section .text-white,
.card .text-white {
    color: var(--text-primary) !important;
}

.faq-item .text-white,
.faq-content .text-white,
.faq-answer .text-white {
    color: var(--text-primary) !important;
}

[data-theme="light"] .text-white,
[data-theme="light"] .faq-item .text-white,
[data-theme="light"] .bg-gray-800 .text-white,
[data-theme="light"] .bg-gray-900 .text-white {
    color: #1e293b !important;
}

[data-theme="dark"] .text-white,
[data-theme="dark"] .faq-item .text-white,
[data-theme="dark"] .bg-gray-800 .text-white,
[data-theme="dark"] .bg-gray-900 .text-white {
    color: #ffffff !important;
}

/* Accent colors */
.text-cyan-400, .text-blue-600 {
    color: var(--accent-primary) !important;
}

.text-cyan-100, .text-blue-100 {
    color: var(--accent-hover) !important;
}

.text-purple-400, .text-purple-600 {
    color: var(--accent-primary) !important;
}

/* Button styles */
.bg-cyan-600, .bg-blue-600, .bg-purple-600 {
    background-color: var(--accent-primary) !important;
}

.bg-cyan-600:hover, .bg-blue-600:hover, .bg-purple-600:hover {
    background-color: var(--accent-hover) !important;
}

.bg-cyan-500, .bg-blue-500 {
    background-color: var(--accent-hover) !important;
}

/* Border colors */
.border-cyan-800, .border-blue-800, .border-gray-200 {
    border-color: var(--border-color) !important;
}

.border-cyan-600, .border-blue-600 {
    border-color: var(--accent-primary) !important;
}

/* Form inputs */
input, textarea {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Theme toggle button */
#themeToggle {
    background-color: var(--bg-card) !important;
    color: var(--accent-primary) !important;
    border: 1px solid var(--border-color) !important;
}

#themeToggle:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Comprehensive Theme Overrides */
[data-theme="light"] .bg-black,
[data-theme="light"] .bg-gray-900,
[data-theme="light"] .bg-gray-800 {
    background-color: var(--bg-card) !important;
    box-shadow: 0 4px 6px var(--shadow-color) !important;
}

[data-theme="light"] section {
    background-color: var(--bg-secondary) !important;
}

[data-theme="light"] header {
    background-color: var(--header-bg) !important;
    border-bottom-color: var(--border-color) !important;
    box-shadow: 0 2px 4px var(--shadow-color) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

[data-theme="light"] #mobileMenu {
    background-color: var(--header-bg) !important;
    border-top: 1px solid var(--border-color) !important;
}

[data-theme="light"] .pricing-card,
[data-theme="light"] .feature-card {
    background-color: #ffffff !important;
    border-color: var(--card-border) !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07) !important;
}

[data-theme="light"] .from-cyan-900 { --tw-gradient-from: var(--accent-secondary) !important; }
[data-theme="light"] .to-blue-900   { --tw-gradient-to:   var(--accent-primary)   !important; }
[data-theme="light"] .text-black    { color: var(--text-primary) !important; }

/* Dark mode overrides */
[data-theme="dark"] .bg-black    { background-color: var(--bg-primary)   !important; }
[data-theme="dark"] .bg-gray-900 { background-color: var(--bg-secondary) !important; }
[data-theme="dark"] .bg-gray-800 { background-color: var(--bg-card)      !important; }

/* Comprehensive text visibility fixes */
* {
    color: inherit !important;
}

/* Force proper text colors in all contexts */
.text-white {
    color: var(--text-primary) !important;
}

.text-gray-300, .text-gray-400, .text-gray-500, .text-gray-600 {
    color: var(--text-secondary) !important;
}

/* All elements inside white text containers */
.text-white *,
.text-white span,
.text-white p,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.text-white li,
.text-white div,
.text-white strong,
.text-white em {
    color: var(--text-primary) !important;
}

/* FAQ specific fixes */
.faq-item,
.faq-content,
.faq-answer,
.faq-question {
    color: var(--text-primary) !important;
}

/* Card content fixes */
.card-content,
.pricing-card *,
.feature-card *,
.bg-gray-800 *,
.bg-gray-900 *,
.bg-white * {
    color: var(--text-primary) !important;
}

/* Override any conflicting styles */
[data-theme="light"] * {
    color: inherit !important;
}

[data-theme="light"] .text-white,
[data-theme="light"] .text-white *,
[data-theme="light"] .faq-item,
[data-theme="light"] .bg-gray-800 *,
[data-theme="light"] .bg-gray-900 * {
    color: #1e293b !important;
}

[data-theme="dark"] * {
    color: inherit !important;
}

[data-theme="dark"] .text-white,
[data-theme="dark"] .text-white *,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .bg-gray-800 *,
[data-theme="dark"] .bg-gray-900 * {
    color: #ffffff !important;
}

/* Theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Enhanced hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom button styles */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile menu improvements */
#mobileMenu {
    transition: all 0.3s ease;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.card-hover:hover {
    border-color: #3b82f6;
    transform: translateY(-5px);
}

/* Feature grid animations */
.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    color: #3b82f6;
}

.feature-icon {
    transition: all 0.3s ease;
}

/* Pricing card improvements */
.pricing-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.pricing-card:hover::before {
    left: 100%;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Contact form styling */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2);
}

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

/* Error message styling */
.error-message {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .bg-white {
        background-color: #374151 !important;
    }
    
    .text-gray-600 {
        color: #d1d5db !important;
    }
    
    .text-gray-800 {
        color: #f9fafb !important;
    }
}

/* Custom animations for scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Text shadow for better readability */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom focus styles */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading skeleton */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}