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

body {
    font-family: 'Segoe UI', sans-serif;
    background-image: url('images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #333;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 🔹 Page Container */
.page-container {
    padding: 2rem;
}

/* 🔹 Top Bar */
.top-bar {
    position: absolute;
    top: 0px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

/* 🔹 Logo (desktop) */
.logo {
    flex-shrink: 0;
}

.logo img {
    height: 100px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(19%) sepia(99%) saturate(2731%) hue-rotate(190deg) brightness(90%) contrast(101%);
}

/* 🔹 Desktop Navigation */
.nav-links.desktop-nav {
    position: absolute;
    left: 85%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: #0063A6;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-links a:hover {
    background-color: #e3f2fd;
    color: #084694;
}

/* 🔹 Hamburger Menu */
.hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #0063A6;
    cursor: pointer;
    position: absolute;
    top: 40px;
    right: 20px;
    z-index: 20;
}

/* 🔹 Mobile Logo */
.mobile-logo {
    display: none;
}

.mobile-logo img {
    height: 100px;
    position: absolute;
    top: 20px;
    left: 0px; /* ✅ Add this to move it inward from left edge */
    z-index: 15;
    filter: brightness(0) saturate(100%) invert(19%) sepia(99%) saturate(2731%) hue-rotate(190deg) brightness(90%) contrast(101%);
}

/* 🔹 Mobile Dropdown Nav */
.nav-links.mobile-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 90px;
    right: 20px;
    width: 240px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
    animation: slideFade 0.3s ease;
    padding: 12px 0;
}

.nav-links.mobile-nav.show {
    display: flex;
}

.nav-links.mobile-nav a {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #0a66c2;
    text-decoration: none;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.nav-links.mobile-nav a:last-child {
    border-bottom: none;
}

.nav-links.mobile-nav a:hover {
    background-color: #e3f2fd;
    color: #084694;
    padding-left: 28px;
}

@keyframes slideFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* 🔹 Title */
.title-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.title {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-top: 80px;
    margin-bottom: 40px;
}

/* 🔹 Client Grid */
.client-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

/* 🔹 Flip Card */
.client-card {
    perspective: 1000px;
    background: transparent;
    border: none;
    padding: 0;
    height: 180px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    border-radius: 24px;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.5), 0 0 12px rgba(33, 150, 243, 0.2);
}

.client-card:hover .flip-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: rgba(255, 255, 255, 0.85);
}

.card-front img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.card-back {
    background-color: #0063a6;
    color: white;
    transform: rotateY(180deg);
    flex-direction: column;
    text-align: center;
    overflow: hidden;
    word-wrap: break-word;
}

/* ✅ Updated styles for link on name */
.card-back a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
    display: block;
    transition: color 0.3s;
}

.card-back a:hover {
    text-decoration: underline;
    color:white;
}

.card-back a h3 {
    margin: 0;
    font-size: 0.6rem;
    color: inherit;
}

/* 🔹 Responsive Layout */
@media (max-width: 1024px) {
    .client-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .client-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .top-bar {
        display: none;
    }

    .mobile-logo {
        display: block;
    }

    .hamburger {
        display: block;
    }

    .desktop-nav {
        display: none;
    }

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

    .title {
        font-size: 1.6rem;
        margin-top: 120px;
    }

    .client-card {
        height: 160px;
    }

    .card-front img {
        max-height: 100px;
    }
}
