/* =========================================
   1. GLOBAL RESETS & BASE
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #000000;
    color: #d4af37; /* Metallic Gold */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; 
    padding: 30px 20px; 
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

/* --- FIX: Hide double-nav if injection works --- */
#header-placeholder + .main-nav, 
#header-placeholder + .header-bottom {
    display: none;
}

/* --- FIX: Constrain images in project details --- */
.gallery-hero-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* =========================================
   2. BUTTONS & ACTIVE STATES
========================================= */
.main-nav a.active, 
.mobile-nav a.active, 
.footer-top a.active {
    background-color: #d4af37;
    color: #000000;
    padding: 3px;
    border-radius: 4px;
}

.btn-primary {
    background-color: #d4af37;
    color: #000000;
    padding: 12px 24px; 
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #d4af37;
    border: 2px solid #d4af37;
    padding: 10px 22px; 
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #d4af37;
    color: #000000;
}

/* =========================================
   3. HEADER (TOP & NAVIGATION)
========================================= */
.main-header {
    background-color: #000000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px; 
}

.header-socials {
    flex: 1;
    display: flex;
    gap: 15px;
    flex-shrink: 0; /* Protects socials from squishing */
}

.header-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 25px; /* Creates an invisible bumper so it never touches the buttons */
    min-width: 150px; /* Allows shrinking but prevents it disappearing */
}

/* New responsive logo class */
.nav-logo-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    transition: max-width 0.3s ease;
}

.header-auth {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; /* Forces buttons to keep their full size */
    white-space: nowrap; /* Stops buttons from wrapping weirdly */
}

/* Tablet Shrinkage: Shrinks the logo smoothly before it hits the mobile breakpoint */
@media (max-width: 950px) {
    .nav-logo-img {
        max-width: 220px;
    }
}

/* --- Login Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.auth-btn {
    background-color: #d4af37;
    color: #000000;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: #ffffff;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #111111;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    z-index: 1;
    border-radius: 4px;
    border: 1px solid #332b00;
    overflow: hidden;
}

.dropdown-content a {
    color: #d4af37;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #222222;
}

.dropdown-content a:hover {
    background-color: #222222;
    color: #ffffff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- Bottom Nav Bar --- */
.header-bottom {
    border-top: 3px solid #d4af37;
    border-bottom: 3px solid #d4af37;
    padding: 10px 0; 
    background-color: #000000;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 30px; 
    flex-wrap: wrap; 
}

.main-nav a {
    text-decoration: none;
    color: #d4af37;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #ffffff;
}

/* =========================================
   4. FOOTER & COPYRIGHT
========================================= */
.main-footer {
    background-color: #000000;
}

.footer-top {
    border-top: 3px solid #d4af37;
    border-bottom: 3px solid #d4af37;
    padding: 15px 0; 
    display: flex;
    justify-content: center;
    gap: 25px;
    background-color: #000000;
}

.footer-top a {
    text-decoration: none;
    color: #d4af37;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-top a:hover {
    color: #ffffff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    padding: 15px 30px; 
}

.footer-left {
    flex: 1;
    display: flex;
    padding-left: 20px; 
    padding-top: 10px; 
}

.agency-signature {
    display: flex;
    flex: 2;
    text-align: left;
}

/* =========================================
   5. SERVICE & CONTENT ROWS
========================================= */
.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.service-row.reverse {
    flex-direction: row-reverse;
}

.service-content {
    flex: 1;
    text-align: left;
}

.service-content h2 {
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.service-content p {
    color: #999999;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.service-content ul {
    list-style: none;
    padding: 0;
}

.service-content ul li {
    color: #ffffff;
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

.service-content ul li::before {
    content: '✓';
    color: #d4af37;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.service-icon-large {
    flex: 1;
    font-size: 5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-icon-large img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   9. PAGE: PORTFOLIO.HTML
========================================= */
.portfolio-section {
    padding: 0 10px;
}

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

.portfolio-card {
    background-color: #0a0a0a;
    border: 1px solid #332b00;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    border-color: #d4af37;
}

.portfolio-image-placeholder {
    background-color: #1a1a1a;
    height: 150px; 
    display: flex;
    justify-content: center;
    align-items: center;
    color: #444;
    border-bottom: 1px solid #332b00;
}

.portfolio-img {
    width: 100%;
    height: 150px; 
    object-fit: cover; 
    border-bottom: 1px solid #332b00;
}

.portfolio-info {
    padding: 15px; 
    text-align: left;
}

.portfolio-info h3 {
    color: #ffffff;
    font-size: 1.15rem; 
    margin-bottom: 8px;
}

.portfolio-info p {
    color: #999999;
    line-height: 1.4;
    margin-bottom: 15px;
    font-size: 0.9rem; 
}

.portfolio-link {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.portfolio-link:hover {
    color: #ffffff;
}

/* =========================================
   11. PAGE: PROJECT DETAILS (CASE STUDY)
========================================= */
.project-detail-main {
    max-width: 1000px; 
    text-align: left;
}

.project-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--gold, #d4af37);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.project-titles h1 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.accent-text {
    color: #d4af37;
    font-size: 1.1rem;
    font-weight: 600;
}

.project-gallery {
    margin-bottom: 40px; 
}

.large-placeholder {
    height: 400px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto; 
    padding-bottom: 10px;
}

.thumb-placeholder {
    min-width: 100px;
    height: 70px;
    background-color: #1a1a1a;
    border: 2px solid transparent;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumb-placeholder:hover, 
.thumb-placeholder.active {
    border-color: #d4af37;
    background-color: #222;
    color: #d4af37;
}

.project-specs-section {
    margin-top: 30px;
    padding: 15px 0;
    border-top: 1px solid var(--gold, #d4af37);
}

.project-specs-section h2 {
    color: #d4af37;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.spec-item {
    background: #111;
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid var(--gold, #d4af37);
}

.spec-label {
    display: block;
    color: var(--gold, #d4af37);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.spec-value {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.4;
}

.back-nav {
    text-align: center;
    padding-top: 15px;
}

/* =========================================
   12. PAGE: CONTACT.HTML
========================================= */
.contact-section {
    padding: 0 10px 40px 10px;
}

.contact-container {
    display: flex;
    gap: 40px; 
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.contact-info {
    flex: 1;
}

.contact-info h2 {
    color: #d4af37;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.contact-info p {
    color: #999999;
    line-height: 1.5;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 1.05rem;
}

.info-icon {
    font-size: 1.3rem;
}

.contact-form-wrapper {
    flex: 1;
    background-color: #0a0a0a;
    border: 1px solid #332b00;
    border-radius: 8px;
    padding: 30px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    color: #d4af37;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input,
.input-group select,
.input-group textarea {
    background-color: #111111;
    border: 1px solid #332b00;
    color: #ffffff;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, outline 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #d4af37;
    outline: none;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

::placeholder {
    color: #555555;
}

.full-width-btn {
    width: 100%;
    margin-top: 5px;
}

.clickable-contact {
    cursor: pointer;
    position: relative; 
    transition: color 0.3s ease;
}

.clickable-contact:hover {
    color: #d4af37;
}

.contact-custom-icon {
    width: 22px; 
    height: auto;
    transition: opacity 0.3s ease;
}

.clickable-contact:hover .contact-custom-icon {
    opacity: 0.8;
}

.copy-feedback {
    position: absolute;
    top: -25px;
    left: 35px;
    background-color: #d4af37;
    color: #000000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0; 
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; 
    display: none; 
    margin-left: 5px;
}

/* =========================================
   13. AUTH PAGES (Login/Signup)
========================================= */
.register-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 15px; 
}

.register-container {
    background-color: #0a0a0a;
    border: 1px solid #332b00;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-box { margin-bottom: 20px; }
.logo-box img { width: 160px; }

.register-container h2 { color: #ffffff; margin-bottom: 5px; font-size: 1.6rem; }
.subtitle { color: #999; margin-bottom: 25px; font-size: 0.9rem; }

.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; color: #d4af37; margin-bottom: 6px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input { 
    width: 100%; padding: 12px; background: #111; border: 1px solid #332b00; 
    color: #fff; border-radius: 4px; font-size: 0.95rem;
}
.form-group input:focus { border-color: #d4af37; outline: none; }

.btn-submit {
    width: 100%; padding: 12px; background: #d4af37; border: none; 
    color: #000; font-weight: bold; border-radius: 4px; cursor: pointer; 
    font-size: 0.95rem; transition: background 0.3s;
}
.btn-submit:hover { background: #ffffff; }

.alert-error { color: #ff4444; margin-bottom: 15px; font-weight: bold; padding: 8px; border: 1px solid #ff4444; border-radius: 4px; background: rgba(255, 68, 68, 0.1); }
.error-text { color: #ff4444; font-size: 0.75rem; display: none; margin-top: 5px; }
.input-error { border-color: #ff4444 !important; }

.switch-auth { margin-top: 20px; color: #999; font-size: 0.85rem; }
.switch-auth a { color: #d4af37; text-decoration: none; font-weight: 600; }
.switch-auth a:hover { color: #ffffff; }

/* =========================================
   PROJECT IMAGE SIZING FIX
========================================= */
#main-gallery-view {
    width: 75%; 
    max-width: 1000px; 
    height: 50vh; 
    min-height: 250px; 
    margin: 0 auto; 
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
    border-radius: 8px;
}

#main-gallery-view img {
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

/* =========================================
   10. RESPONSIVE DESIGN (THE 1/3RD RULE)
========================================= */
.mobile-menu,
.hamburger-btn {
    display: none;
}

/* --- Mobile / Tablet Consolidated Rule --- */
@media (max-width: 768px), (max-height: 400px) {
    /* Tablet & Mobile Content Stacking - FORCED */
    .service-row, .service-row.reverse {
        display: flex !important;
        flex-direction: column !important; /* Forces them to stack like a tower */
        padding: 20px 10px;
        gap: 20px;
    }
    
    .service-icon-large {
        order: 1 !important; /* Forces the icon to be item #1 (the top) */
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 0px;
    }
    
    .service-icon-large img {
        max-width: 100px !important; /* Keeps the cog from taking over the whole screen */
        margin: 0 auto;
        display: block;
    }

    .service-content {
        order: 2 !important; /* Forces the text to be item #2 (the bottom) */
        width: 100%;
        text-align: center;
    }

    .service-content ul li {
        text-align: left; 
        display: inline-block;
    }
    
    .contact-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .project-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .large-placeholder {
        height: 250px;
    }

    /* Header & Navigation Adjustments - TRUE CENTER */
    .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between; /* Pushes FB left, Hamburger right */
        position: relative;
        padding: 10px 20px;
        min-height: 60px;
    }

    /* Force the Facebook icon to show on mobile */
    .header-socials {
        display: flex !important; 
        z-index: 10;
    }

    /* Hide the Auth buttons and Bottom nav on mobile */
    .header-auth, 
    .header-bottom { 
        display: none; 
    }

    /* Mathematically pin the logo to the center */
    .header-logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0;
        z-index: 2;
        width: auto;
    }

    .hamburger-btn {
        display: flex;
        margin: 0;
        z-index: 10;
    }

    .mobile-menu.active {
        display: block;
    }

    /* Footer Adjustments */
    .footer-top {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-left {
        align-items: center;
        padding-left: 0;
    }

    .footer-logo {
        margin-left: 0;
    }
    
    .footer-bottom::after {
        display: none;
    }
}