/* ============================================================
   global.css – Shared body styles for HR Consultant website
   ============================================================ */

:root {
    --clr-primary: #1C64F2;
    --clr-primary-dark: #1551c2;
    --clr-primary-light: #e8f0fe;
    --clr-accent: #B31942;
    --clr-accent-hover: #9c1238;
    --clr-accent-light: #fce4ec;
    --clr-green: #25D366;
    --clr-green-hover: #1fb855;
    --clr-bg: #F8F9FA;
    --clr-surface: #FFFFFF;
    --clr-text: #0A1628;
    --clr-text-light: #4B5563;
    --clr-border: #E5E7EB;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --fs-base: 1rem;
    --fs-sm: 0.875rem;
    --max-width: 1280px;
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

/* GLOBAL OVERFLOW SAFETY – prevents any horizontal scroll/clipping */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--clr-text);
    background-color: var(--clr-bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--clr-primary);
    text-underline-offset: 2px;
    transition: color 0.2s;
}
a:hover { color: var(--clr-primary-dark); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: var(--fs-sm);
    border-radius: 50px;
    text-decoration: none;
    min-height: 48px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.btn-primary { background: var(--clr-primary); color: #fff; }
.btn-primary:hover { background: var(--clr-primary-dark); transform: translateY(-2px); }
.btn-accent { background: var(--clr-accent); color: #fff; }
.btn-accent:hover { background: var(--clr-accent-hover); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--clr-primary); border: 2px solid var(--clr-primary); }
.btn-outline:hover { background: var(--clr-primary); color: #fff; }
.btn-chat { background: var(--clr-green); color: #fff; }
.btn-chat:hover { background: var(--clr-green-hover); transform: translateY(-2px); }
.btn-lg { padding: 1rem 2.2rem; font-size: 1rem; min-height: 56px; }

/* ===== BOOK APPOINTMENT BUTTON – match course page min‑height ===== */
.header-container .btn.desk-only {
    min-height: 44px !important;
}

/* SECTIONS */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-accent);
    margin-bottom: 0.5rem;
}
.section-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    color: var(--clr-text);
    margin-bottom: 0.5rem;
}
.section-header p {
    color: var(--clr-text-light);
    max-width: 640px;
    margin: 0 auto;
    font-size: var(--fs-sm);
}

/* ========== STATS BAR – 100% CLIPPING FIX (FINAL) ========== */
.stats-bar-dark {
    background: var(--clr-text);
    color: #fff;
    padding: 2.5rem 0;
    position: relative;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100%;
}
.stats-bar-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(28,100,242,0.2) 0%, transparent 60%);
}

/* Ensure container doesn't introduce overflow */
.stats-bar-dark .container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
    overflow-x: visible;
}

/* GRID: flexible with a safe minimum width */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    text-align: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

.stat-card-dark {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 1.25rem 0.5rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
    min-width: 0;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}
.stat-card-dark:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.12);
}
.stat-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.stat-number { font-size: clamp(1.5rem, 5vw, 2.5rem); font-weight: 900; display: block; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.8); margin-top: 0.3rem; }

/* On phones (<480px) – stack cards vertically – 100% guarantee no clipping */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .stat-card-dark {
        padding: 1rem 0.5rem;
    }
}

/* ABOUT SECTION (text left, image right) */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}
.about-content h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--clr-text); margin-bottom: 1rem; }
.about-content p { color: var(--clr-text-light); margin-bottom: 0.85rem; }
.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
.about-stat {
    background: var(--clr-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--clr-border);
    border-top: 3px solid var(--clr-accent);
}
.about-stat-number { font-size: 1.6rem; font-weight: 900; color: var(--clr-accent); display: block; }
.about-stat-label { font-size: 0.8rem; color: var(--clr-text-light); }
.about-image { text-align: center; }
.about-image img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 500px; margin: 0 auto; }

/* SERVICES GRID */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.service-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--clr-border);
    transition: all 0.2s;
    border-top: 3px solid transparent;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-top-color: var(--clr-accent); }
.service-icon { font-size: 2rem; margin-bottom: 0.6rem; display: block; }
.service-card h3 { font-size: 0.9rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.25rem; }
.service-card p { font-size: 0.78rem; color: var(--clr-text-light); }

/* TABS */
.tabs-container {
    background: var(--clr-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--clr-border);
}
.tabs-nav {
    display: flex;
    overflow-x: auto;
    background: var(--clr-text);
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.tab-btn {
    flex: 1 0 auto;
    min-width: 90px;
    padding: 1rem 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--clr-accent);
    background: rgba(255,255,255,0.1);
}
.tab-panel { display: none; padding: 2rem; }
.tab-panel.active { display: block; }

/* DESTINATION CARDS */
.destinations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.dest-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--clr-border);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.dest-card:hover { box-shadow: var(--shadow); border-color: var(--clr-primary); transform: translateY(-2px); }
.flag-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; color: var(--clr-text); }
.flag { font-size: 1.5rem; }
.feature {
    font-size: 0.8rem;
    color: var(--clr-text-light);
    border-left: 3px solid var(--clr-primary-light);
    padding-left: 0.6rem;
    line-height: 1.4;
}
.feature strong { display: block; text-transform: uppercase; font-size: 0.7rem; color: var(--clr-text); margin-bottom: 0.1rem; }
.dest-link {
    margin-top: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-accent);
    text-decoration: none;
}
.dest-link:hover { color: var(--clr-primary); text-decoration: underline; }
.region-all-link { text-align: center; margin-top: 2rem; }
.region-all-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--clr-accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s;
}
.region-all-link a:hover { background: var(--clr-accent-hover); transform: translateY(-2px); }

/* COURSES TAGS */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}
.course-tag {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 50px;
    padding: 0.6rem 0.9rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--clr-text);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}
.course-tag:hover { background: var(--clr-accent); color: #fff; border-color: var(--clr-accent); }

/* RESOURCE CARDS */
.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.resource-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--clr-border);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.resource-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-left: 4px solid var(--clr-primary); }
.resource-card h3 { font-size: 1rem; font-weight: 700; color: var(--clr-text); }
.resource-card p { font-size: 0.85rem; color: var(--clr-text-light); }

/* ISLAMABAD CONTENT */
.isb-content {
    background: var(--clr-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--clr-accent);
}
.isb-content h2 { font-size: 1.8rem; font-weight: 700; color: var(--clr-text); margin-bottom: 1rem; }
.isb-content p { color: var(--clr-text-light); margin-bottom: 0.8rem; }

/* CTA SECTION (dark) */
.cta-section {
    background: linear-gradient(135deg, var(--clr-text) 0%, #101d33 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 55%;
    height: 160%;
    background: radial-gradient(ellipse, rgba(28,100,242,0.2) 0%, transparent 70%);
}
.cta-section h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: 0.75rem; }
.cta-section p { opacity: 0.9; max-width: 500px; margin-left: auto; margin-right: auto; }

/* RESPONSIVE */
@media (min-width: 600px) {
    .destinations-grid { grid-template-columns: repeat(2, 1fr); }
    .resources-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1.2fr 1fr; }
    .about-image { text-align: right; }
}
@media (min-width: 900px) {
    .destinations-grid { grid-template-columns: repeat(3, 1fr); }
    .resources-grid { grid-template-columns: repeat(3, 1fr); }
    .services-grid { grid-template-columns: repeat(4, 1fr); }
    .courses-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ===== SAFE LOGO ENLARGEMENT ===== */
.logo img {
    height: 75px !important;
    width: auto !important;
    max-width: 100% !important;
}

/* ===== BOOK APPOINTMENT BUTTON – GLOBAL LOCK ===== */
a[href="book-appointment.html"] {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.88rem !important;
    min-height: 44px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
}

/* ===== MOBILE FIXES ===== */
@media (max-width: 767px) {
    img, video, iframe, svg {
        max-width: 100% !important;
        height: auto !important;
    }
    body {
        overflow-x: hidden;
    }
}

/* ===== AUTO STACKED CARDS FOR ALL TABLES ON MOBILE ===== */
@media (max-width: 767px) {
    table:not(.no-stack) {
        display: block;
    }
    table:not(.no-stack) thead {
        display: none;
    }
    table:not(.no-stack) tbody {
        display: block;
    }
    table:not(.no-stack) tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    table:not(.no-stack) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px dashed #e5e7eb;
        white-space: normal;
    }
    table:not(.no-stack) td:last-child {
        border-bottom: none;
    }
    table:not(.no-stack) td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #0A172A;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
}/* Helper for JS-fixed table cells */
.overflow-fixed-cell::before {
    content: attr(data-label);
    font-weight: 700;
    margin-right: 0.5rem;
    flex-shrink: 0;
} /* Auto-fix helper for tables – ensures data-label is visible */
@media (max-width: 767px) {
    td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 1rem;
        flex-shrink: 0;
        color: #0A1628;
    }
    /* Prevent any hidden overflow from ancestors */
    .stats-bar-dark,
    .container,
    .section {
        overflow-x: visible !important;
    }
}