/* ═══════════════════════════════════════════════════════════
   CloudGuard Portfolio — Site-Wide Animations
   ═══════════════════════════════════════════════════════════ */

/* ── Respect reduced motion preference ─────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
    50%       { box-shadow: 0 0 20px 4px rgba(99,102,241,0.25); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
@keyframes borderPulse {
    0%, 100% { border-color: rgba(99,102,241,0.2); }
    50%       { border-color: rgba(99,102,241,0.6); }
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}
@keyframes blinkCursor {
    0%, 100% { border-right-color: #6366f1; }
    50%       { border-right-color: transparent; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spinOnce {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    animation: fadeInDown 0.5s ease both;
}
.nav-links a {
    position: relative;
    transition: color 0.25s ease;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ── Hero Section ───────────────────────────────────────── */
.hero-content {
    animation: fadeInUp 0.8s ease both;
}
.hero-content h1 {
    animation: fadeInUp 0.8s ease 0.1s both;
}
.hero-content p {
    animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-content .btn,
.hero-content .cta-buttons a {
    animation: fadeInUp 0.8s ease 0.3s both;
}
.hero-stats,
.stats-grid {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ── Animated gradient hero background ─────────────────── */
.hero::before,
.arch-hero::before,
.cs-hero::before {
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

/* ── Section titles ─────────────────────────────────────── */
.section-title {
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 0; height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: width 0.6s ease;
}
.section-title.aos-animate::after { width: 60px; }

/* ── Project / Case Study Cards ─────────────────────────── */
.cs-card,
.project-card,
.card {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.3s ease,
                border-color 0.3s ease !important;
}
.cs-card:hover,
.project-card:hover,
.card:hover {
    transform: translateY(-6px) scale(1.01) !important;
    box-shadow: 0 20px 50px rgba(99,102,241,0.18) !important;
}

/* ── Stat / Info Cards ──────────────────────────────────── */
.stat-card,
.cert-card,
.skill-card,
.expertise-card,
.benefit-card,
.cost-strategy-card,
.detail-card,
.tl-content {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn,
.cs-view-btn,
.nav-book-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease !important;
    position: relative;
    overflow: hidden;
}
.btn::after,
.cs-view-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.btn:hover::after,
.cs-view-btn:hover::after { transform: scaleX(1); }
.btn:hover,
.cs-view-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(99,102,241,0.35) !important;
}
.btn:active,
.cs-view-btn:active { transform: translateY(0) !important; }

/* ── Cloud provider pills / badges ─────────────────────── */
.cloud-card,
.arch-platform-pill,
.about-badge {
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}
.cloud-card:hover,
.arch-platform-pill:hover { transform: translateY(-4px) !important; }

/* ── Filter pills ───────────────────────────────────────── */
.cs-pill,
.filter-btn {
    transition: all 0.2s ease !important;
}
.cs-pill:hover,
.filter-btn:hover { transform: translateY(-1px); }

/* ── Footer links ───────────────────────────────────────── */
.footer-col a,
.footer-social a {
    transition: color 0.2s ease, transform 0.2s ease !important;
    display: inline-flex;
    align-items: center;
}
.footer-social a:hover { transform: translateY(-3px) scale(1.15) !important; }
.footer-col a:hover { transform: translateX(4px) !important; }

/* ── Theme switcher ─────────────────────────────────────── */
.theme-toggle-btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    animation: float 4s ease-in-out infinite;
}
.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg) !important;
    animation: none;
}
.theme-panel {
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

/* ── Back to top button ─────────────────────────────────── */
.back-to-top,
#backToTop {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}
.back-to-top:hover,
#backToTop:hover { transform: translateY(-4px) scale(1.1) !important; }

/* ── Logo ───────────────────────────────────────────────── */
.logo {
    transition: transform 0.3s ease !important;
}
.logo:hover { transform: scale(1.04) !important; }

/* ── Timeline dots ──────────────────────────────────────── */
.tl-dot,
.journey-dot {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.tl-item:hover .tl-dot,
.journey-item:hover .journey-dot {
    transform: scale(1.4) !important;
    box-shadow: 0 0 0 6px rgba(99,102,241,0.2) !important;
}

/* ── Connect cards ──────────────────────────────────────── */
.connect-card {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.connect-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
}

/* ── Certification cards ────────────────────────────────── */
.cert-card {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease !important;
}
.cert-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    animation: pulseGlow 1.5s ease infinite;
}

/* ── Skill cards ────────────────────────────────────────── */
.skill-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.skill-card:hover { transform: translateY(-5px) !important; }

/* ── Progress bar animation ─────────────────────────────── */
.progress-bar,
.progress-fill {
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ── Page load — stagger children ──────────────────────── */
.expertise-grid .expertise-card:nth-child(1) { animation-delay: 0.05s; }
.expertise-grid .expertise-card:nth-child(2) { animation-delay: 0.10s; }
.expertise-grid .expertise-card:nth-child(3) { animation-delay: 0.15s; }
.expertise-grid .expertise-card:nth-child(4) { animation-delay: 0.20s; }
.expertise-grid .expertise-card:nth-child(5) { animation-delay: 0.25s; }
.expertise-grid .expertise-card:nth-child(6) { animation-delay: 0.30s; }

.certs-grid .cert-card:nth-child(1)  { animation-delay: 0.05s; }
.certs-grid .cert-card:nth-child(2)  { animation-delay: 0.08s; }
.certs-grid .cert-card:nth-child(3)  { animation-delay: 0.11s; }
.certs-grid .cert-card:nth-child(4)  { animation-delay: 0.14s; }
.certs-grid .cert-card:nth-child(5)  { animation-delay: 0.17s; }
.certs-grid .cert-card:nth-child(6)  { animation-delay: 0.20s; }
.certs-grid .cert-card:nth-child(7)  { animation-delay: 0.23s; }
.certs-grid .cert-card:nth-child(8)  { animation-delay: 0.26s; }

/* ── Scroll reveal helper classes ───────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ── Stagger delays for reveal children ─────────────────── */
.stagger-children > *:nth-child(1)  { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.40s; }

/* ── Shimmer loading skeleton ───────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* ── Active nav highlight pulse ─────────────────────────── */
.nav-links a.active {
    animation: none;
}

/* ── Image hover zoom ───────────────────────────────────── */
.platform-diagram img,
.cost-diagram img {
    transition: transform 0.4s ease !important;
}
.platform-diagram:hover img,
.cost-diagram:hover img {
    transform: scale(1.02) !important;
}

/* ── Booking section cards ──────────────────────────────── */
.booking-card,
.service-card,
.contact-card {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.3s ease,
                border-color 0.3s ease !important;
}
.booking-card:hover,
.service-card:hover,
.contact-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 24px 60px rgba(99,102,241,0.2) !important;
}

/* ── Input focus animation ──────────────────────────────── */
input:focus,
textarea:focus,
.cs-search:focus {
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}

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