/* ==========================================================================
   TenderGlobal - Ads & Clients Pages Scoped Styles (Enhanced)
   ========================================================================== */

/* --- Title Bar Brand Badges --- */
.tg-title-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-inline-start: auto;
    padding-inline-end: 8px;
}

.tg-title-badge {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
}

.tg-title-badge:hover {
    transform: scale(1.1);
}

.tg-page-shell {
    --brand-color: #2e8795;
    --brand-color-dark: #246d78;
    --brand-accent: #ff7f27;
    --bg-light: #f4f7f9;
    --text-main: #2b2b2b;
    --text-muted: #5a5a5a;
    --card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.10);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    font-family: inherit;
    color: var(--text-main);
    background: linear-gradient(180deg, var(--bg-light) 0%, #edf1f4 100%);
    padding: 40px 0;
}

/* --- Hero & Content Sections --- */
.tg-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
    background: #ffffff;
    padding: 45px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.tg-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-color), var(--brand-accent));
    border-radius: 16px 16px 0 0;
}

/* --- Gradient variant (matches About page abt-story-visual) --- */
.tg-hero.tg-hero-gradient {
    background: linear-gradient(135deg, #2e8795 0%, #f5833d 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 32px rgba(46, 135, 149, 0.25);
}

.tg-hero.tg-hero-gradient::before {
    content: '';
    top: -40px;
    right: -40px;
    left: auto;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.tg-hero.tg-hero-gradient::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -30px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.tg-hero-gradient .tg-hero-content h3 {
    color: #ffffff;
}

.tg-hero-gradient .tg-hero-content p {
    color: rgba(255, 255, 255, 0.85);
}

.tg-hero-gradient .tg-hero-visual svg circle,
.tg-hero-gradient .tg-hero-visual svg line,
.tg-hero-gradient .tg-hero-visual svg path {
    stroke: rgba(255, 255, 255, 0.35);
    fill: rgba(255, 255, 255, 0.08);
}

.tg-hero-gradient .tg-hero-visual svg circle[fill="#2e8795"],
.tg-hero-gradient .tg-hero-visual svg circle[fill="#ff7f27"] {
    fill: rgba(255, 255, 255, 0.2);
}

.tg-hero-content {
    flex: 1 1 350px;
}

.tg-hero-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.tg-hero-content h3 {
    color: var(--brand-color);
    margin-top: 0;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.tg-hero-content p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 16px;
    margin-bottom: 24px;
}

.tg-hero-visual {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tg-hero-visual img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.tg-hero-visual svg {
    max-width: 100%;
    height: auto;
}

/* --- Brand Square Logos --- */
.tg-brand-squares {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tg-brand-sq {
    object-fit: contain;
    border-radius: 0;
    background: none;
    padding: 0;
    box-shadow: none;
    border: none;
    transition: transform 0.25s var(--ease-smooth);
}

.tg-brand-sq:hover {
    transform: scale(1.05);
}

.tg-sq-logo {
    width: 88px;
    height: 88px;
}

.tg-sq-since {
    width: 70px;
    height: 70px;
}

/* --- Stats Grid --- */
.tg-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tg-stat-card {
    background: linear-gradient(135deg, var(--brand-color), var(--brand-color-dark));
    color: #ffffff;
    padding: 32px 24px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(46, 135, 149, 0.22);
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

/* Decorative circle — top-right (matches abt-story-visual ::before) */
.tg-stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

/* Decorative circle — bottom-left (matches abt-story-visual ::after) */
.tg-stat-card::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.tg-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 36px rgba(46, 135, 149, 0.3);
}

.tg-stat-card strong {
    display: block;
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
    position: relative;
}

.tg-stat-card span {
    font-size: 14px;
    opacity: 0.92;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
}

/* --- Stat Card Color Variants (Brand Identity) --- */
.tg-stat-teal {
    background: linear-gradient(135deg, #2e8795, #246d78);
    box-shadow: 0 8px 24px rgba(46, 135, 149, 0.25);
}
.tg-stat-teal:hover {
    box-shadow: 0 14px 36px rgba(46, 135, 149, 0.35);
}

.tg-stat-orange {
    background: linear-gradient(135deg, #ff7f27, #d46815);
    box-shadow: 0 8px 24px rgba(255, 127, 39, 0.25);
}
.tg-stat-orange:hover {
    box-shadow: 0 14px 36px rgba(255, 127, 39, 0.35);
}

.tg-stat-green {
    background: linear-gradient(135deg, #98ce44, #6d9a2c);
    box-shadow: 0 8px 24px rgba(152, 206, 68, 0.25);
}
.tg-stat-green:hover {
    box-shadow: 0 14px 36px rgba(152, 206, 68, 0.35);
}

.tg-stat-blue {
    background: linear-gradient(135deg, #5bc0de, #3a9cb8);
    box-shadow: 0 8px 24px rgba(91, 192, 222, 0.25);
}
.tg-stat-blue:hover {
    box-shadow: 0 14px 36px rgba(91, 192, 222, 0.35);
}

/* --- Contact Cards (Ads Page) --- */
.tg-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.tg-contact-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    padding: 22px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s var(--ease-smooth);
}

.tg-contact-card:hover {
    border-color: var(--brand-color);
    box-shadow: 0 8px 24px rgba(46, 135, 149, 0.12);
    transform: translateY(-3px);
}

.tg-contact-icon {
    font-size: 32px;
    color: var(--brand-accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-contact-info {
    display: flex;
    flex-direction: column;
}

.tg-contact-info small {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 500;
}

.tg-contact-info h5, 
.tg-contact-info a {
    margin: 0;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s var(--ease-smooth);
}

.tg-contact-info a:hover, 
.tg-contact-info a:focus {
    color: var(--brand-color);
}

/* --- Clients Logo Grid --- */
.tg-clients-section {
    margin-top: 60px;
}

.tg-section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 35px;
    position: relative;
    padding-bottom: 15px;
    letter-spacing: -0.3px;
}

.tg-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-color));
    border-radius: 2px;
}

.tg-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.tg-logo-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.25s var(--ease-smooth);
    text-align: center;
    overflow: hidden;
}

.tg-logo-card:hover {
    border-color: var(--brand-color);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

.tg-logo-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.55;
    transition: all 0.3s var(--ease-smooth);
}

.tg-logo-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* --- Insights Section (Ads Page) --- */
.tg-insights-section {
    margin-bottom: 55px;
}

.tg-stat-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- Growth Cards --- */
.tg-growth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
}

.tg-growth-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--brand-color);
    border-radius: 12px;
    padding: 28px 25px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.tg-growth-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.tg-growth-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(46,135,149,0.08), rgba(46,135,149,0.15));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tg-growth-icon svg {
    width: 28px;
    height: 28px;
}

.tg-growth-info h4 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-color);
}

.tg-growth-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

/* --- MENA / Our Branches --- */
.tg-mena-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tg-mena-highlight {
    display: flex;
    justify-content: center;
}

.tg-mena-big-stat {
    background: linear-gradient(135deg, var(--brand-color), var(--brand-color-dark));
    color: #ffffff;
    padding: 40px 55px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(46, 135, 149, 0.28);
    max-width: 620px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.tg-mena-big-stat::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.tg-mena-big-stat strong {
    display: block;
    font-size: 68px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
    position: relative;
}

.tg-mena-big-stat span {
    font-size: 18px;
    opacity: 0.92;
    line-height: 1.5;
    position: relative;
}

.tg-mena-countries {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.tg-mena-country {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.25s var(--ease-smooth);
}

.tg-mena-country:hover {
    border-color: var(--brand-color);
    box-shadow: 0 8px 24px rgba(46, 135, 149, 0.12);
    transform: translateY(-3px);
}

.tg-mena-country img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.tg-mena-country-info {
    display: flex;
    flex-direction: column;
}

.tg-mena-country-info strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.tg-mena-country-info span {
    font-size: 13px;
    color: #1a6a75;
    font-weight: 700;
}

/* --- Responsive & RTL --- */
html[dir="rtl"] .tg-contact-card {
    flex-direction: row;
}

html[dir="rtl"] .tg-contact-info {
    text-align: right;
}

html[dir="rtl"] .tg-growth-card {
    flex-direction: row;
    border-left: 1px solid var(--card-border);
    border-right: 4px solid var(--brand-color);
}

html[dir="rtl"] .tg-mena-country {
    flex-direction: row;
}

html[dir="rtl"] .tg-mena-country-info {
    text-align: right;
}

@media (max-width: 768px) {
    .tg-hero {
        padding: 25px;
        flex-direction: column;
        text-align: center;
    }
    
    .tg-hero::before {
        border-radius: 12px 12px 0 0;
    }
    
    .tg-contact-card {
        justify-content: center;
        text-align: center;
    }
    
    html[dir="rtl"] .tg-contact-info {
        text-align: center;
    }
    
    .tg-stat-card strong {
        font-size: 28px;
    }
    
    .tg-stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tg-growth-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        border-left: 1px solid var(--card-border);
        border-top: 4px solid var(--brand-color);
    }
    
    .tg-mena-big-stat strong {
        font-size: 48px;
    }
    
    .tg-mena-big-stat {
        padding: 25px 30px;
    }
    
    .tg-mena-countries {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tg-logo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .tg-logo-card {
        height: 100px;
        padding: 15px;
    }
}

@media (max-width: 414px) {
    .tg-page-shell {
        padding: 20px 0;
    }
    
    .tg-hero-content h3 {
        font-size: 26px;
    }
    
    .tg-stat-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    
    .tg-growth-grid {
        grid-template-columns: 1fr;
    }
    
    .tg-mena-big-stat strong {
        font-size: 40px;
    }
    
    .tg-mena-countries {
        grid-template-columns: 1fr 1fr;
    }
    
    .tg-logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
