/* ============================================
   ENHANCED STYLES WITH ANIMATIONS
   Added: AOS animations, number counters, trust badges
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap");
@import url("https://unpkg.com/aos@2.3.1/dist/aos.css");

:root {
    /* Brand Colors - Matched to TNBF Logo */
    --primary-color: #003366; /* Navy Blue from logo */
    --primary-dark: #002244;
    --primary-light: #335588;
    --primary-gradient: linear-gradient(135deg, #003366, #002244);

    --cta-color: #d32f2f; /* Red for CTAs */
    --cta-hover: #b71c1c;
    --cta-gradient: linear-gradient(135deg, #d32f2f, #b71c1c);

    --accent-color: #4caf50; /* Green for success */
    --accent-dark: #388e3c;

    --trust-color: #335588; /* Blue for trust badges */

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    /* Background Colors */
    --background-white: #ffffff;
    --background-light: #f8fafc;
    --background-dark: #0f172a;

    --border-color: #e2e8f0;

    /* Typography */
    --font-heading: "Poppins", sans-serif;
    --font-body: "Inter", sans-serif;

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

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl:
        0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(
        0,
        0,
        0,
        0.04
    );
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--background-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
}
h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
}
h3 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-slow);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
    position: relative;
}

.logo img {
    height: 90px;
    width: auto;
    margin-top: 10px;
    transition: transform var(--transition-base);
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-toggle:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.6);
}

.nav-links a:not(.btn) {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:not(.btn)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-base);
}

.nav-links a:not(.btn):hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0)
    );
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--cta-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-slow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(14, 165, 233, 0.03),
        rgba(14, 165, 233, 0)
    );
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

/* Hero Section */
.hero {
    padding: var(--spacing-3xl) 0;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
}

/* Hero Content Alignment Helpers */
.hero-content-left {
    text-align: left;
}

.hero-content-right {
    text-align: right;
}

/* Hero Layout Helpers */
.hero-left-aligned {
    background-position: left center;
}

.hero-right-aligned {
    background-position: right center;
}

/* Hero Readability Helpers */
.hero-text-shadow {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-overlay-dark {
    background-image: linear-gradient(
        135deg,
        rgba(0, 51, 102, 0.8),
        rgba(0, 34, 68, 0.95)
    );
}

.hero-overlay-side {
    background-image: linear-gradient(
        to right,
        rgba(0, 51, 102, 0.9),
        rgba(0, 34, 68, 0.5)
    );
}

.hero-overlay-side-rev {
    background-image: linear-gradient(
        to left,
        rgba(0, 51, 102, 0.9),
        rgba(0, 34, 68, 0.5)
    );
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero h1 {
    color: white;
    margin-bottom: 1.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    max-width: 1000px;
    margin: 0 auto 2rem;
}

/* Simplified Hero for Sub-pages */
.hero-simple {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: auto; /* Override default hero height if any */
}

.hero-simple::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-simple h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.hero-simple p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Trust Badges (NEW) */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.trust-badge svg, .trust-badge i {
    font-size: 1.5rem;
}

/* Stats Counter (NEW) */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Sticky Apply Button */
.sticky-apply {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    padding: 1.25rem 2.5rem;
    background: var(--cta-gradient);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.4);
    animation: pulse 2s ease-in-out infinite;
    transition: all var(--transition-base);
    text-decoration: none;
}

.sticky-apply:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 40px rgba(211, 47, 47, 0.5);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(211, 47, 47, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(211, 47, 47, 0.6);
    }
}

/* Popup Modal */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
}

.popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--background-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.popup-close:hover {
    background: var(--cta-color);
    color: white;
    transform: rotate(90deg);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

/* Chatbot Widget */
.chatbot-trigger {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    z-index: 998;
    transition: all var(--transition-base);
    animation: bounce 2s ease-in-out infinite;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 51, 102, 0.5);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Grid System */
.container {
    width: 95%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.grid {
    display: grid;
    gap: var(--spacing-xl);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-header h2 {
    margin-bottom: var(--spacing-md);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 900px;
    margin: 0 auto;
}

/* Footer */
footer {
    background: var(--background-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
    margin-top: var(--spacing-3xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 0.5rem;
    transition: all var(--transition-base);
}

.footer-section a:hover {
    color: var(--primary-light);
    padding-left: 0.5rem;
}

.footer-section img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 1rem 0;
    }

    .logo img {
        height: 64px;
        margin-top: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.75rem);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 1001;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a:not(.btn) {
        padding: 0.75rem 0.25rem;
    }

    .nav-links a:not(.btn)::after {
        display: none;
    }

    .nav-links .btn {
        width: 100%;
        padding: 0.9rem 1.25rem;
    }

    .sticky-apply {
        bottom: 20px;
        right: 20px;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .chatbot-trigger {
        bottom: 100px;
        left: 20px;
        width: 50px;
        height: 50px;
    }

    .container {
        width: 95%;
        padding: 0 1rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}
.mb-0 {
    margin-bottom: 0;
}
.mb-1 {
    margin-bottom: var(--spacing-md);
}
.mb-2 {
    margin-bottom: var(--spacing-lg);
}
.mb-3 {
    margin-bottom: var(--spacing-xl);
}

/* Industry Card Enhancements */
.industry-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base);
    background: white;
}

.industry-image-container {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc; /* Fallback light gray */
}

.industry-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.industry-card:hover .industry-image-container img {
    transform: scale(1.1);
}

.industry-icon-fallback {
    position: absolute;
    font-size: 3.5rem;
    z-index: 2;
    display: none; /* Only show when image fails */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.industry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.industry-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

/* Featured Industry Colors (Gradients for fallbacks) */
.textile-bg {
    background: linear-gradient(135deg, #1e293b, #334155);
}
.jewellery-bg {
    background: linear-gradient(135deg, #b45309, #d97706);
}
.construction-bg {
    background: linear-gradient(135deg, #334155, #475569);
}
.fmcg-bg {
    background: linear-gradient(135deg, #065f46, #059669);
}
/* Industries Horizontal Scroller */
.industries-scroller {
    overflow: hidden;
    padding: var(--spacing-xl) 0;
    position: relative;
    width: 100%;
    margin: 2rem 0;
}

.industries-track {
    display: flex;
    gap: var(--spacing-xl);
    width: max-content;
    animation: infinite-scroll-left 40s linear infinite;
}

.industries-scroller:hover .industries-track {
    animation-play-state: paused;
}

.scroller-card {
    flex: 0 0 350px; /* Fixed width for carousel items */
    transition: transform var(--transition-base);
}

.scroller-card:hover {
    transform: translateY(-10px);
}

@keyframes infinite-scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-350px * 6 - var(--spacing-xl) * 6));
    }
}

/* Add a fade effect at the edges */
.industries-scroller::before,
.industries-scroller::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.industries-scroller::before {
    left: 0;
    background: linear-gradient(to right, var(--background-white), transparent);
}

.industries-scroller::after {
    right: 0;
    background: linear-gradient(to left, var(--background-white), transparent);
}

@keyframes infinite-scroll-left-mobile {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-280px * 6 - var(--spacing-xl) * 6));
    }
}

@media (max-width: 768px) {
    .scroller-card {
        flex: 0 0 280px;
    }
    .industries-track {
        animation: infinite-scroll-left-mobile 30s linear infinite;
    }
}
