/* InteSys Corporate Website — Custom Styles */

/* ===== CSS Variables ===== */
:root {
    --intesys-primary: #2563eb;
    --intesys-primary-light: #3b82f6;
    --intesys-accent: #0ea5e9;
    --intesys-dark-bg: #0a0a0a;
    --intesys-dark-surface: #171717;
    --intesys-dark-card: #0f172a;
}

/* ===== Glass Morphism — Dark (default since dark-first) ===== */
.glass-effect {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
    transform: translateY(-4px);
}

.glass-nav {
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ===== Glass Morphism — Light mode ===== */
html:not(.dark) .glass-effect,
html:not(.dark) .glass-card {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html:not(.dark) .glass-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
}

html:not(.dark) .glass-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

/* ===== Gradient Backgrounds — Dark ===== */
.gradient-dark-bg {
    background: linear-gradient(180deg, #0a0a0a 0%, #0f172a 40%, #1e1b4b 100%);
}

.gradient-hero {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a0a 0%, #0f172a 100%);
}

/* ===== Gradient Backgrounds — Light ===== */
html:not(.dark) .gradient-dark-bg {
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 40%, #e0f2fe 100%);
}

html:not(.dark) .gradient-hero {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(14, 165, 233, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

/* ===== Gradient Text ===== */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 40%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Animated Grid Background ===== */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(100, 116, 139, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

html:not(.dark) .grid-pattern {
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
}

/* ===== Glow Effects ===== */
.glow-blue {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Staggered animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ===== CTA Gradient ===== */
.gradient-cta {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0284c7 100%);
}

/* ===== Stats Counter ===== */
.stat-number {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light mode stat numbers need more contrast */
html:not(.dark) .stat-number {
    background: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Preferences Panel ===== */
.preferences-panel .preferences-dropdown {
    display: none;
    position: absolute;
    right: 0;
    min-width: 200px;
    z-index: 50;
}

.preferences-panel.active .preferences-dropdown {
    display: block;
}

/* ===== Mobile Navigation ===== */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 500px;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

html:not(.dark) ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

html:not(.dark) ::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

/* ===== HTMX Loading ===== */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
    pointer-events: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Glass Form Inputs ===== */
.glass-input {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #f1f5f9;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.glass-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.glass-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

html:not(.dark) .glass-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    color: #1e293b;
}

html:not(.dark) .glass-input::placeholder {
    color: rgba(100, 116, 139, 0.6);
}

html:not(.dark) .glass-input:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Tool Result Cards ===== */
.result-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-warning {
    background: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-success p, .result-error p, .result-warning p {
    margin: 0;
}

/* ===== Smooth Scroll ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Selection Color ===== */
::selection {
    background: rgba(37, 99, 235, 0.3);
    color: inherit;
}
