/* --- CSS Variables (Theme) --- */
:root {
    --font-primary: "Raleway", sans-serif;
    --font-secondary: "Montserrat", sans-serif;
    --font-tertiary: "Playfair Display", serif;
    --color-primary: #0a0a0a; /* Very dark grey, almost black */
    --color-secondary: #1a1a1a; /* Dark grey */
    --color-text: #eaeaea;
    --color-accent: #c49963; /* Muted, elegant gold */
    --color-white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

h2, h3 {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--color-white);
    line-height: 1.2;
}


h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}

p {
    font-family: var(--font-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.small-container {
    max-width: 700px;
}

/*section {
    padding: 6rem 0;
}*/

.cta-button {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-primary);
    padding: 0.8rem 2.5rem;
    border: 2px solid var(--color-accent);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--color-accent);
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Left spacer, centered logo, right nav */
    align-items: center;
    z-index: 1000;
    background: #00000030;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
    border-bottom: 1px solid #2d2d2d;
}

.logo-container {
    width: 150px;
    height: 154px;
    grid-column: 2;
    display: flex;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--color-white);
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo img {
    margin-right: 0.5rem;
    width: 150px;
    height: 154px;
    color: var(--color-accent);
}

.navbar {
    grid-column: 3;
    justify-self: end;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2.5rem;
}

.nav-link {
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--color-white);
}

.nav-link.cta-link {
    border: 2px solid var(--color-accent);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    color: var(--color-accent);
}

.nav-link.cta-link:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.menu-toggle,
.nav-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle {
    grid-column: 3;
    justify-self: end;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    min-height: 700px;
    display: flex;
    justify-content: center;
    text-align: center;
    position: relative;
    background: url("https://mapgolfinnovations.com/img/map_home_bg.png") no-repeat center center/cover;
    background-attachment: fixed;
    align-items: end;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 50px;
    background-color: #00000012;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
    margin: 0 0 70px 0;
}

.hero-content h1 {
    font-family: var(--font-tertiary);
    font-size: 60px;
    color: #fff;
}

.hero-content p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/*main section:first-of-type {
    padding: 202px 0px; /* Desktop header height (154px logo + 2*1.5rem padding)
}*/


/* --- Features Section --- */
.features {
    background: url("https://mapgolfinnovations.com/img/map_home_bg_02.png") no-repeat center center/cover;
    background-attachment: fixed;
    padding-top: 250px;
    padding-bottom: 70px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    border: 1px solid #363535;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #0000005e;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
}

.feature-item:hover {
    border-color: var(--color-accent);
    transform: translateY(-5px);
}

/* --- Gallery Section --- */
.gallery {
    padding-top: 250px;
    padding-bottom: 70px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    width: 100%;
    height: 350px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: grayscale(30%);
}

.gallery-item:hover {
    opacity: 0.8;
    transform: scale(1.03);
    filter: grayscale(0%);
}

/* --- About Section --- */
.about {
    background: url("https://mapgolfinnovations.com/img/map_Parragraph_bg.png") no-repeat center center/cover;
    /*background-color: var(--color-secondary);*/
    text-align: center;
    padding-top: 250px;
    padding-bottom: 70px;
}

.about p {
    font-size: 1.25rem;
    font-weight: 300;
}

.name_higlight {
    color: var(--color-accent);
    font-weight: 600;
}

/* --- Contact Section --- */
.contact {
    background-color: var(--color-secondary);
    padding-top: 250px;
    padding-bottom: 70px;
}

.contact-intro {
    text-align: center;
    font-size: 1.1rem;
    max-width: 500px;
    margin: -2rem auto 2.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-secondary);
    border: 1px solid #333;
    border-radius: 5px;
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.form-group select option {
    background-color: var(--color-secondary);
    color: var(--color-text);
}

#contact-form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.form-success {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #1a2a1a;
    border: 1px solid #2a4a2a;
    color: #8ae38a;
    text-align: center;
    border-radius: 5px;
}

/* --- Footer --- */
footer {
    background-color: var(--color-secondary);
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid #333;
}

footer p {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
}

/* --- Gallery Modal --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    animation: zoomIn 0.3s;
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    color: var(--color-white);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2020; /* Ensure it's above image and nav */
}

.modal-close:hover {
    color: var(--color-accent);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: var(--color-white);
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    padding: 1rem;
    user-select: none; /* Prevents text selection */
    transition: all 0.3s ease;
}

.modal-nav:hover {
    color: var(--color-accent);
    background-color: rgba(0, 0, 0, 0.3); /* Add bg on hover */
}

#modal-prev {
    left: 5rem;
}

#modal-next {
    right: 5rem;
}

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

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

/* --- Responsive Styles --- */

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.5rem;
    }

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

@media (max-width: 768px) {
    /* Mobile Header & Nav */
    header {
        padding: 1rem 5%;
        background: var(--color-secondary); /* Solid background on mobile */
        position: fixed; /* Stick to top */
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .logo-container {
        /* Logo remains centered */
        grid-column: 2;
        width: auto;
        height: auto;
    }

    .logo-container .logo img {
        width: 80px;
        height: 82px;
    }
    
    .logo span {
        display: none;
    }

    .navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background-color: var(--color-secondary);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        transition: right 0.35s ease-in-out;
        z-index: 1200;
        grid-column: auto;
        justify-self: auto;
        display: block;
        padding-top: 5rem;
    }

    .navbar.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .nav-link {
        font-size: 1.2rem;
    }

    .nav-link.cta-link {
        padding: 0.8rem 1.5rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-close-btn {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1.5rem;
    }

    /* Mobile Hero */
    .hero {
        padding: 300px 0 0 0; /* Mobile header height */
        background-attachment: scroll;
    }

    .hero-content  {
        margin: 600px 0 50px 0;
    }

    .features {
        background-attachment: scroll;
        background-position: right;
    }

    .features, .gallery, .about, .contact {
        padding: 130px 0 30px 0; /* Mobile header height */
    }
    
    h1 {
        font-size: 2.8rem;
    }

    /* Mobile Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .gallery-item {
        height: 200px;
    }

    /* --- UPDATED: Full-Screen Mobile Modal --- */
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%; /* Override desktop max-width */
        max-height: 100vh; /* Override desktop max-height */
        object-fit: contain; /* Ensure image fits without distortion */
        margin: 0;
        animation: fadeIn 0.3s; /* Use fadeIn instead of zoom */
    }

    .modal-close {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 2rem;
        /* Add a background for better visibility */
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-nav {
        font-size: 2.5rem;
        padding: 0.5rem;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 5px;
    }
    #modal-prev {
        left: 0.5rem;
    }
    #modal-next {
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 15px;
    }
    .cta-button {
        width: 100%;
        padding: 1rem;
        font-size: 12px;
    }
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    .gallery-item {
        height: 180px;
    }
}