/**
 * AI-SEO Content Automator — Custom CSS Overrides
 * Tailwind CDN handles most styling; this file adds custom animations & utilities
 */

/* ─── Smooth Scroll ────────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* ─── Custom Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ─── Fade-In Animation (Intersection Observer) ───────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for child elements */
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ─── Pulse Glow Effect for CTAs ──────────────────────────────────────────── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
}

.pulse-glow {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ─── Floating Animation ──────────────────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* ─── Gradient Text Animation ─────────────────────────────────────────────── */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease-in-out infinite;
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ─── Form Field Focus Ring Enhancement ───────────────────────────────────── */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ─── Selection Color ─────────────────────────────────────────────────────── */
::selection {
    background-color: rgba(37, 99, 235, 0.2);
    color: #1e293b;
}

/* ─── Mobile Menu Transition ──────────────────────────────────────────────── */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

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

/* ─── Navbar Scroll State ─────────────────────────────────────────────────── */
#navbar.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ─── Button Loading State ────────────────────────────────────────────────── */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* ─── Timeline Animation ──────────────────────────────────────────────────── */
@keyframes draw-line {
    from { height: 0; }
    to { height: 100%; }
}

/* ─── Counter Animation ───────────────────────────────────────────────────── */
@keyframes count-up {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.stat-number {
    animation: count-up 0.6s ease-out forwards;
}

/* ─── Responsive Typography Fine-Tuning ───────────────────────────────────── */
@media (max-width: 640px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
}

/* ─── Print Styles ─────────────────────────────────────────────────────────── */
@media print {
    header, footer, .pulse-glow { display: none; }
    .fade-in { opacity: 1; transform: none; }
}