/* ==========================================================================
   ISB Vietnam Standalone Glossary Page - SaaS Redesign
   Design System: Minimal, Clean, Modern B2B (Linear / Stripe inspired)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Required Brand & Interface Colors */
    --isb-bg-page: #F8FAFC;
    --isb-bg-card: #FFFFFF;
    --isb-primary-accent: #2563EB;
    --isb-text-title: #111827;
    --isb-text-body: #64748B;
    --isb-border-color: #E2E8F0;
    --isb-navy-dark: #0f172a;

    /* Spacing & Radii */
    --isb-container-width: 1200px;
    --isb-radius-card: 20px;
    --isb-radius-pill: 50px;

    /* Subtle SaaS Box Shadows */
    --isb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --isb-shadow-hover: 0 20px 30px -10px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.04);
    --isb-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);

    /* Typography & Micro-interactions */
    --isb-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --isb-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base CSS Reset
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.isb-glossary-page {
    font-family: var(--isb-font);
    background-color: var(--isb-bg-page);
    color: var(--isb-text-title);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.isb-container {
    max-width: var(--isb-container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Hero Banner Section
   ========================================================================== */
.isb-page-hero {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%),
        url('../../images/glossary/glossary-banner.png') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0 90px 0;
    text-align: center;
    position: relative;
}

.isb-breadcrumbs {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 24px;
    text-align: left;
}

.isb-breadcrumbs a {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--isb-transition);
}

.isb-breadcrumbs a:hover {
    color: #ffffff;
}

.isb-breadcrumbs .separator {
    margin: 0 8px;
    color: #64748b;
}

.isb-breadcrumbs .current {
    color: #ffffff;
    font-weight: 500;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: #ffffff;
}

.hero-description {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 720px;
    margin: 0 auto 40px auto;
    font-weight: 400;
    line-height: 1.7;
}

/* Live Search Bar */
.glossary-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.glossary-search-wrapper input {
    width: 100%;
    padding: 18px 56px 18px 28px;
    font-size: 1rem;
    font-family: var(--isb-font);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--isb-radius-pill);
    background-color: rgba(255, 255, 255, 0.98);
    color: var(--isb-text-title);
    box-shadow: var(--isb-shadow-lg);
    outline: none;
    transition: var(--isb-transition);
}

.glossary-search-wrapper input:focus {
    background-color: #ffffff;
    border-color: var(--isb-primary-accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

.glossary-search-wrapper .search-icon {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--isb-text-body);
}

/* ==========================================================================
   Main Content Layout & 3-Column Responsive Grid
   ========================================================================== */
.isb-main-content {
    padding: 80px 0 100px 0;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    /* Increased card spacing */
}

/* ==========================================================================
   SaaS Service Card Component
   ========================================================================== */
.glossary-card {
    position: relative;
    background-color: var(--isb-bg-card);
    border: 1px solid var(--isb-border-color);
    border-radius: var(--isb-radius-card);
    padding: 32px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--isb-shadow-sm);
    transition: var(--isb-transition);
}

/* Soft Blue Gradient Highlight Line at top of Card */
.card-accent-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563EB 0%, #60A5FA 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Card Header (Icon & Badge Layout) */
.glossary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* Colorful Icon Container */
.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

/* Category Badge */
.category-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: var(--isb-radius-pill);
    background-color: #F1F5F9;
    color: #475569;
}

/* Card Content Typography */
.card-body {
    flex-grow: 1;
}

.glossary-term-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--isb-text-title);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.glossary-term-excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: var(--isb-text-body);
    margin-bottom: 28px;
}

/* Modern CTA Button */
.glossary-card-footer {
    margin-top: auto;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--isb-primary-accent);
    transition: var(--isb-transition);
}

.read-more .cta-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* ==========================================================================
   Micro Interactions & Card Theme Variations
   ========================================================================== */

/* Hover State Animations */
.glossary-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--isb-shadow-hover);
    border-color: #CBD5E1;
}

.glossary-card:hover .card-accent-line {
    opacity: 1;
}

.glossary-card:hover .card-icon-wrapper {
    transform: scale(1.08);
}

.glossary-card:hover .glossary-term-title {
    color: var(--isb-primary-accent);
}

.glossary-card:hover .read-more .cta-arrow {
    transform: translateX(6px);
}

/* Focus State for Accessibility */
.glossary-card:focus-visible {
    outline: 2px solid var(--isb-primary-accent);
    outline-offset: 4px;
}

/* Subtle Visual Theme Cycles (Pastel Icon BG + Accent Gradients) */
/* Cycle 1: Primary Blue */
.glossary-card:nth-child(6n + 1) .card-icon-wrapper {
    background-color: #EFF6FF;
    color: #2563EB;
}

.glossary-card:nth-child(6n + 1) .card-accent-line {
    background: linear-gradient(90deg, #2563EB, #60A5FA);
}

/* Cycle 2: Indigo */
.glossary-card:nth-child(6n + 2) .card-icon-wrapper {
    background-color: #EEF2FF;
    color: #4F46E5;
}

.glossary-card:nth-child(6n + 2) .card-accent-line {
    background: linear-gradient(90deg, #4F46E5, #818CF8);
}

/* Cycle 3: Emerald */
.glossary-card:nth-child(6n + 3) .card-icon-wrapper {
    background-color: #ECFDF5;
    color: #059669;
}

.glossary-card:nth-child(6n + 3) .card-accent-line {
    background: linear-gradient(90deg, #059669, #34D399);
}

/* Cycle 4: Purple */
.glossary-card:nth-child(6n + 4) .card-icon-wrapper {
    background-color: #F5F3FF;
    color: #7C3AED;
}

.glossary-card:nth-child(6n + 4) .card-accent-line {
    background: linear-gradient(90deg, #7C3AED, #A78BFA);
}

/* Cycle 5: Amber */
.glossary-card:nth-child(6n + 5) .card-icon-wrapper {
    background-color: #FFFBEB;
    color: #D97706;
}

.glossary-card:nth-child(6n + 5) .card-accent-line {
    background: linear-gradient(90deg, #D97706, #FBBF24);
}

/* Cycle 6: Rose */
.glossary-card:nth-child(6n + 6) .card-icon-wrapper {
    background-color: #FFF1F2;
    color: #E11D48;
}

.glossary-card:nth-child(6n + 6) .card-accent-line {
    background: linear-gradient(90deg, #E11D48, #FB7185);
}

/* ==========================================================================
   No Search Results Message
   ========================================================================== */
.no-results-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--isb-bg-card);
    border-radius: var(--isb-radius-card);
    border: 1px dashed var(--isb-border-color);
    color: var(--isb-text-body);
}

.no-results-msg h3 {
    font-size: 1.25rem;
    color: var(--isb-text-title);
    margin-bottom: 8px;
}

/* ==========================================================================
   Lead Generation Call to Action (CTA) Card
   ========================================================================== */
.isb-cta-card {
    margin-top: 72px;
    background: linear-gradient(135deg, #ffffff 0%, #EEF5FF 100%);
    border: 1px solid #BFDBFE;
    border-radius: var(--isb-radius-card);
    padding: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--isb-shadow-sm);
}

.cta-content h2 {
    font-size: 1.75rem;
    color: var(--isb-text-title);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cta-content p {
    color: var(--isb-text-body);
    font-size: 1rem;
    max-width: 600px;
}

.isb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--isb-primary-accent);
    color: #ffffff;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: var(--isb-radius-pill);
    text-decoration: none;
    transition: var(--isb-transition);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.isb-btn-primary:hover {
    background-color: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    color: #fff;
}

/* ==========================================================================
   Responsive Auto Breakpoints (3 Cols -> 2 Cols -> 1 Col)
   ========================================================================== */
@media (max-width: 1024px) {
    .glossary-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on Tablet */
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .isb-page-hero {
        padding: 50px 0 70px 0;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
        /* 1 column on Mobile */
        gap: 20px;
    }

    .glossary-card {
        padding: 24px;
    }

    .isb-cta-card {
        flex-direction: column;
        text-align: center;
        gap: 24px;
        padding: 32px 24px;
    }
}

/* ==========================================================================
   Scroll Reveal & Staggered Wave Animations
   ========================================================================== */

/* Initial State: Hidden and shifted down */
.glossary-card {
    opacity: 0;
    transform: translateY(32px);
    will-change: opacity, transform;
    /* Move transition-delay out of the shorthand so we can control it per column */
    transition-property: opacity, transform, box-shadow, border-color;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Revealed State */
.glossary-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for 3-column desktop layout (Card 1 -> Card 2 -> Card 3) */
.glossary-card:nth-child(3n + 1) {
    transition-delay: 0ms;
}

.glossary-card:nth-child(3n + 2) {
    transition-delay: 120ms;
    /* 120ms delay for 2nd card in row */
}

.glossary-card:nth-child(3n + 3) {
    transition-delay: 240ms;
    /* 240ms delay for 3rd card in row */
}

/* Reset transition-delay on hover so user interactions remain instant */
.glossary-card.is-visible:hover {
    transition-delay: 0ms !important;
    transform: translateY(-6px);
    box-shadow: var(--isb-shadow-hover);
    border-color: #CBD5E1;
}