/* ================================================
   TAPG Homepage - Premium Gold & Black Design
   with South African Flag Accent Colors
   ================================================ */

:root {
    /* Primary Colors */
    --gold: #DAA520;
    --gold-dark: #B8860B;
    --black: #000000;
    --white: #FFFFFF;

    /* South African Flag Colors */
    --sa-green: #007749;
    --sa-red: #DE3831;
    --sa-blue: #002395;
    --sa-yellow: #FFB81C;

    /* Neutral Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --bg-light: #f8f9fa;

    /* Gradients */
    --sa-gradient: linear-gradient(90deg, var(--sa-green), var(--sa-yellow), var(--sa-red), var(--sa-blue), var(--black));
    --gold-gradient: linear-gradient(135deg, var(--gold-dark), var(--gold));

    /* Effects */
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    --shadow-gold: 0 10px 30px -5px rgba(218, 165, 32, 0.3);
}

body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--white);
    font-family: 'Poppins', sans-serif;
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(218, 165, 32, 0.2));
    z-index: 1;
}

/* SA Flag Accent Border */
.hero-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--sa-gradient);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 1060px;
    width: 100%;
    text-align: center;
}

.hero-content h2 {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.3s;
}

.hero-content p:not(.hero-tagline) {
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1.5;
    color: var(--white);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.6s;
}

/* Sub-tagline above service grid */
.hero-tagline {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 1.5rem;
    margin-top: -1.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.8s ease forwards 0.75s;
}

/* ================================================
   HERO SERVICE GRID
   ================================================ */
.hero-service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

/* Individual card */
.hero-service-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(218, 165, 32, 0.25);
    border-radius: 12px;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 0.7s ease forwards;
}

/* Staggered entry */
.hero-service-card:nth-child(1) { animation-delay: 0.85s; }
.hero-service-card:nth-child(2) { animation-delay: 0.95s; }
.hero-service-card:nth-child(3) { animation-delay: 1.05s; }
.hero-service-card:nth-child(4) { animation-delay: 1.15s; }
.hero-service-card:nth-child(5) { animation-delay: 1.25s; }
.hero-service-card:nth-child(6) { animation-delay: 1.35s; }

/* Gold shimmer left border on hover */
.hero-service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.18), rgba(218, 165, 32, 0.0));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

/* Bottom gold accent bar */
.hero-service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 0 12px 12px;
}

.hero-service-card:hover::before { opacity: 1; }
.hero-service-card:hover::after  { width: 100%; }

.hero-service-card:hover {
    border-color: rgba(218, 165, 32, 0.7);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(218, 165, 32, 0.2);
}

/* Icon circle */
.hsc-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(218, 165, 32, 0.15);
    border: 1px solid rgba(218, 165, 32, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--gold);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.hero-service-card:hover .hsc-icon {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
    transform: scale(1.1) rotate(-5deg);
}

/* Label + arrow row */
.hsc-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.hsc-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.hero-service-card:hover .hsc-label {
    color: var(--gold);
}

.hsc-arrow {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--gold);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.35s ease;
}

.hero-service-card:hover .hsc-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ------------------------------------------------
   RESPONSIVE
   ------------------------------------------------ */
@media (max-width: 860px) {
    .hero-service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .hero-service-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .hero-service-card {
        padding: 0.9rem 1rem;
    }
}

/* ================================================
   SERVICES SECTION
   ================================================ */
.services {
    padding: 6rem 2rem;
    background: var(--white);
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--sa-gradient);
}

.services h2 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    color: var(--black);
    font-weight: 800;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.services h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gold);
}

.services-intro {
    text-align: center;
    max-width: 700px;
    margin: 2rem auto 4rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1.8;
}

.services .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.service-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* SA Color Accent on Cards */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.service-card:nth-child(2)::before {
    background: var(--sa-green);
}

.service-card:nth-child(3)::before {
    background: var(--sa-red);
}

.service-card:nth-child(4)::before {
    background: var(--sa-blue);
}

.service-card:nth-child(5)::before {
    background: var(--gold);
}

.service-card:nth-child(6)::before {
    background: var(--sa-green);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-gold);
}

.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover img {
    transform: scale(1.05);
}

.service-content {
    padding: 2rem;
}

.service-content h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--black);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-content h3 i {
    color: var(--gold);
    font-size: 1.3em;
}

.service-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.btn-link {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: #095d40;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid #095d40;
    transition: var(--transition);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-link:hover {
    background: transparent;
    color: #095d40;
    border-color: #095d40;
}

/* ================================================
   WHY CHOOSE US SECTION
   ================================================ */
.vision-mission-section {
    display: flex;
    align-items: center;
    padding: 6rem 5%;
    gap: 4rem;
    background: var(--bg-light);
    position: relative;
}

.vision-item {
    flex: 1;
    max-width: 600px;
}

.vision-item h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
    color: var(--black);
    font-weight: 800;
    position: relative;
    padding-bottom: 1rem;
}

.vision-item h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gold);
}

.vision-item p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.vision-image {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.vision-image::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--gold);
    border-radius: 8px;
    z-index: 0;
}

.vision-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1;
}

/* ================================================
   PARTNERS SECTION
   ================================================ */
.features-section {
    width: 100%;
    overflow: hidden;
    padding: 6rem 0;
    background: var(--white);
    position: relative;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--sa-gradient);
}

.h2Carousel {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--black);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.h2Carousel::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gold);
}

.pCarousel {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 2rem 10% 3rem;
    line-height: 1.8;
}

.features-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    width: calc(320px * 8);
    animation: carousel 35s linear infinite;
}

.feature-card {
    flex: 0 0 320px;
    padding: 2rem;
    text-align: center;
    background: var(--white);
    margin: 0 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transition: var(--transition);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    box-shadow: var(--shadow-gold);
}

.partner-logo {
    width: 100%;
    height: 180px;
    object-fit: contain;
    transition: var(--transition);
}

.feature-card:hover .partner-logo {
    transform: scale(1.08);
}

@keyframes carousel {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-320px * 4));
    }
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.animate-slide-left,
.animate-slide-right {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-slide-left {
    transform: translateX(-50px);
}

.animate-slide-right {
    transform: translateX(50px);
}

.animate-slide-left.visible,
.animate-slide-right.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */
@media (max-width: 1024px) {
    .hero-section {
        height: 90vh;
    }

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

@media (max-width: 900px) {
    .vision-mission-section {
        flex-direction: column;
        padding: 4rem 5%;
        gap: 3rem;
    }

    .vision-mission-section .vision-image {
        order: -1;
        max-width: 100%;
    }

    .vision-item {
        max-width: 100%;
    }

    .services .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 100vh;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .hero-section .services-grid {
        display: none;
    }

    .services {
        padding: 4rem 1.5rem;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }

    .feature-card {
        flex: 0 0 280px;
    }

    .partner-logo {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 4rem;
    }

    .hero-content p {
        font-size: 1.5rem;
    }

    .services h2,
    .h2Carousel {
        font-size: 2rem;
    }

    .pCarousel {
        font-size: 1rem;
        margin: 1.5rem 5%;
    }
}