/* 
 * AskAboutMigration.com - Premium Modern Design System
 * Phase 1: Core Visual Modernization
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Modern Color Palette */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-accent: #06b6d4;
    --color-accent-dark: #0891b2;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;

    /* Gradient Definitions */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-nz: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-au: linear-gradient(135deg, #f46b45 0%, #eea849 100%);
    --gradient-ca: linear-gradient(135deg, #ec4899 0%, #ef4444 100%);
    --gradient-mesh: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #667eea 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    /* Spacing System */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;

    /* Animation Timing */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.4);
}

/* ============================================
   Typography System
   ============================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

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

* {
    transition: background-color var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}

/* ============================================
   Animated Background Gradient
   ============================================ */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: var(--gradient-mesh);
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

/* ============================================
   Glassmorphism Components
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-radius: var(--radius-lg);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.glass-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-xl);
}

/* ============================================
   Gradient Border Effect
   ============================================ */
.gradient-border {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ============================================
   Enhanced Buttons
   ============================================ */
.btn-modern {
    position: relative;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-modern:hover::before {
    transform: translateX(100%);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-gradient-nz {
    background: var(--gradient-nz);
    color: white;
}

.btn-gradient-au {
    background: var(--gradient-au);
    color: white;
}

.btn-gradient-ca {
    background: var(--gradient-ca);
    color: white;
}

/* ============================================
   Card Hover Effects
   ============================================ */
.card-lift {
    transition: all var(--transition-base);
    cursor: pointer;
}

.card-lift:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-glow-nz:hover {
    box-shadow: 0 20px 40px rgba(17, 153, 142, 0.3);
}

.card-glow-au:hover {
    box-shadow: 0 20px 40px rgba(244, 107, 69, 0.3);
}

.card-glow-ca:hover {
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.3);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* Stagger animation delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* ============================================
   Icon Gradient Backgrounds
   ============================================ */
.icon-gradient-primary {
    background: var(--gradient-primary);
}

.icon-gradient-nz {
    background: var(--gradient-nz);
}

.icon-gradient-au {
    background: var(--gradient-au);
}

.icon-gradient-ca {
    background: var(--gradient-ca);
}

/* ============================================
   Enhanced Form Controls
   ============================================ */
.form-modern input,
.form-modern select,
.form-modern textarea {
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-base);
    background: white;
}

.form-modern input:focus,
.form-modern select:focus,
.form-modern textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-modern label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   Pulse Animation
   ============================================ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse-badge {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Floating Animation
   ============================================ */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

/* ============================================
   Navigation Enhancements
   ============================================ */
.nav-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform var(--transition-base),
        box-shadow var(--transition-base);
}

.nav-hidden {
    transform: translateY(-100%);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
    transform: translateX(100%);
    transition: transform var(--transition-base);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* ============================================
   Scroll Reveal
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Loading States
   ============================================ */
@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;
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
    :root {
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .card-lift:hover {
        transform: translateY(-8px) scale(1.01);
    }
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   Badge & Label Styles
   ============================================ */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    box-shadow: var(--shadow-md);
}

.badge-gradient {
    background: var(--gradient-primary);
    color: white;
}

/* ============================================
   Tab Navigation Enhancement
   ============================================ */
.tab-button {
    position: relative;
    transition: all var(--transition-base);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tab-button.active::after {
    transform: scaleX(1);
}

/* ============================================
   Country Flag Icons Placeholder
   ============================================ */
.flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    margin-bottom: 1rem;
}

/* ============================================
   Stats Counter
   ============================================ */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Decorative Elements
   ============================================ */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    z-index: -1;
}

.blob-primary {
    background: #667eea;
}

.blob-accent {
    background: #06b6d4;
}

/* ============================================
   Country Card Image Rotation
   ============================================ */
.country-card-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.country-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: imageRotate 10s infinite;
}

.country-card-image img:nth-child(1) {
    animation-delay: 0s;
}

.country-card-image img:nth-child(2) {
    animation-delay: 5s;
}

@keyframes imageRotate {

    0%,
    40% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}


/* ============================================
   Print Styles
   ============================================ */
@media print {

    .glass-card,
    .glass-nav,
    .glass-modal {
        background: white !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }

    .animated-gradient {
        background: #667eea !important;
        animation: none !important;
    }
}

/* ============================================
   Messenger Chat Bubble
   ============================================ */
.chat-bubble {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: #0084ff;
    /* Messenger Blue */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 132, 255, 0.5);
}

.chat-bubble i {
    transition: transform 0.3s ease;
}

.chat-bubble:hover i {
    transform: rotate(15deg);
}

/* Pulse Animation for Chat Bubble */
@keyframes chatPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 132, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 132, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 132, 255, 0);
    }
}

.chat-bubble.pulse {
    animation: chatPulse 2s infinite;
}

/* Adjust position if back-to-top button is present */
.back-to-top.visible~.chat-bubble {
    bottom: 6rem;
    /* Move up to avoid overlap */
}