/* 
   Mangalam Agency - Modern Responsive Styles 
   Version: 2.0 (Mobile First)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors */
    --primary-color: #003366;
    /* Deep Blue - Trust */
    --secondary-color: #00b4d8;
    /* Fresh Blue - Air/Water */
    --accent-color: #ffbf00;
    /* Amber - Warning/Safety */
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 180, 216, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease-in-out;
}

/* 1. Global Resets & Typography */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for sticky header */
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    width: 100%;
    margin: 0;
    padding-top: 76px;
    overflow-x: hidden;
}

/* Responsive Typography using clamp() */
h1,
.display-3 {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
}

h2,
.display-5 {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
}

h3,
.display-6 {
    font-size: clamp(1.5rem, 3vw, 2rem) !important;
}

p.lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
}

a {
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. Utility Overrides (Bootstrap) */
.text-primary {
    color: var(--primary-color) !important;
}

.text-info {
    color: var(--secondary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition-normal);
}

.btn:active {
    transform: scale(0.98);
}

.btn-info {
    background-color: var(--secondary-color);
    border: none;
    color: white;
}

.btn-info:hover {
    background-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-outline-info {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-info:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* 3. Header & Navigation */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-brand img {
    border: 2px solid var(--secondary-color);
}

.nav-link {
    font-weight: 500;
    color: #cbd5e1 !important;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color) !important;
}

/* Underline animation for deskop */
@media (min-width: 992px) {
    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--secondary-color);
        transition: width 0.3s ease, left 0.3s ease;
    }

    .nav-link:hover::after,
    .nav-link.active::after {
        width: 80%;
        left: 10%;
    }
}

/* Mobile Toggler & Brand Fixes */
@media (max-width: 576px) {
    .navbar-brand {
        max-width: 70%;
        font-size: 1rem;
    }

    .navbar-brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem;
    }

    .tagline {
        display: none;
    }

    /* Hide tagline on mobile */
}

/* 4. Hero Section */
.hero {
    min-height: 85vh;
    /* Clean dark gradient background */
    background: linear-gradient(135deg, var(--primary-color) 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    position: relative;
    margin-top: -76px;
    /* Pull up behind header */
    padding-top: 100px;
    /* Push content down */
    padding-bottom: 3rem;
}

/* 5. Components & Cards */
.card {
    border: none;
    border-radius: 1rem;
    background: var(--bg-white);
    transition: var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.service-card .card-img-top {
    transition: transform 0.5s ease;
}

.service-card:hover .card-img-top {
    transform: scale(1.05);
    /* Subtle zoom */
}

/* 6. Brands & Logos */
.brand-item {
    background: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition-normal);
    border: 1px solid #e2e8f0;
}

.brand-item:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* 7. Achievements */
.achievements {
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .achievements {
        margin-top: 2rem;
    }

    /* Reset overlap on mobile */
}

.border-end-md {
    border-right: 1px solid #e2e8f0;
}

@media (max-width: 767px) {
    .border-end-md {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}

/* 8. Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 9. Contact Section */
#contact {
    background: linear-gradient(to bottom right, var(--primary-color), #1e293b);
}

.contact-item {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

/* Mobile Fixes for Contact Formatting */
@media (max-width: 480px) {
    .contact-item {
        flex-direction: column;
        text-align: center !important;
        padding: 1.5rem !important;
    }

    .contact-item .text-start {
        text-align: center !important;
    }

    .contact-item .rounded-circle {
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }

    /* Force email wrapping on small screens */
    /* Contact item text adjustments */
    .contact-item span.fs-5 {
        font-size: 1rem !important;
        display: block;
    }

    /* Specific fix for Email to ensure one line */
    .d-flex.flex-column.gap-3.w-100>.contact-item:nth-child(3) span.fs-5 {
        font-size: 0.85rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: normal;
    }
}

/* 10. Floating WhatsApp Button */
.float-whatsapp {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: var(--transition-normal);
}

.float-whatsapp:hover {
    transform: scale(1.1);
    background-color: #20bd5a;
    color: white;
}

/* Responsive Container Tweak */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }
}