/*
============================================================
 Jordan Guild Tech - Common & Global Styles (common.css)
 This file contains all CSS rules shared across all pages,
 such as the header, footer, and animations.
============================================================
*/

/* ==================== GLOBAL STYLES & RESETS ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding-top: 60px;
}

body.homepage {
    padding-top: 0;
}

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

/* ==================== HEADER STYLES ==================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #111827;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.main-header.header-transparent {
    background-color: rgba(17, 24, 39, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 50px;
    margin-right: 10px;
    vertical-align: middle;
}

.logo a {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
}

.main-header.header-transparent .logo a {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: 700;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;        /* prevents multi-line wrapping */
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 25px 20px;
    transition: all 0.3s ease;
    white-space: nowrap;      /* prevents IT SERVICES breaking */
}

.main-header.header-transparent .main-nav a {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 0 2px;
}

.main-nav a:hover {
    color: #ffffff;
    background-color: #60a5fa;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
}

.main-header.header-transparent .main-nav a:hover {
    background-color: rgba(96, 165, 250, 0.9);
    text-shadow: none;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
}

.main-nav a.active-page {
    color: #60a5fa;
    background-color: #4b5563;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
}

.main-header.header-transparent .main-nav a.active-page {
    background-color: rgba(75, 85, 99, 0.5);
    text-shadow: none;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
}

/* === HEADER ACTIONS: SEARCH & MENU HORIZONTAL ALIGNMENT === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.cta-button {
    color: #ffffff;
    background-color: transparent;
    border: 1px solid #ffffff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    margin-right: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button:hover {
    background-color: #ffffff;
    color: #000000;
}

.main-header.header-transparent .cta-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.main-header.header-transparent .cta-button:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 1);
    text-shadow: none;
}

.search-bar {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    overflow: hidden;
    opacity: 0;
    background-color: #111827;
    border: 1px solid #374151;
    border-radius: 5px;
    transition: all 0.4s ease-in-out;
    padding: 5px 0;
}

.search-bar.is-active {
    width: 250px;
    opacity: 1;
    padding: 5px 10px;
}

.search-bar form {
    width: 100%;
}

.search-bar input {
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 0;
    width: 100%;
    color: #ffffff;
}

.search-bar input::placeholder {
    color: #a3a3a3;
}

.search-bar input:focus {
    outline: none;
}

.search-icon {
    color: #ffffff;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.4s ease-in-out;
}

.search-icon.is-active {
    color: #2563eb;
}

.main-header.header-transparent .search-icon {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

.mobile-nav-toggle {
    display: none;
    position: absolute;
    z-index: 2000;
    right: 1.5rem;
    top: 1.5rem;
    background: transparent;
    border: 0;
    width: 2rem;
    aspect-ratio: 1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(255, 255, 255)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

.mobile-nav-toggle[aria-expanded="true"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(255, 255, 255)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M24 6L6 24'/%3e%3c/svg%3e");
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== FOOTER STYLES ==================== */
.site-footer {
    background-color: #ffffff;
    color: #4b5563;
    padding: 60px 5% 20px 5%;
    border-top: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-column h3 {
    color: #111827;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-column p {
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-column ul a:hover {
    color: #111827;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: inline-block;
    width: 36px;
    height: 36px;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 50%;
    padding: 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: #2563eb;
    color: #ffffff;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-info svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    fill: #4b5563;
}

.footer-bottom-bar {
    border-top: 1px solid #e5e7eb;
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ==================== ANIMATIONS ==================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

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

.slide-from-bottom {
    transform: translateY(50px);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

.animate-letters {
    overflow: hidden;
}

.animate-letters .letter {
    display: inline-block;
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s, transform 0.8s;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-letters.is-visible .letter {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== REUSABLE COMPONENTS ==================== */
.card-image-container {
    position: relative;
}

.badge-container {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    z-index: 5;
}

.card-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.card-badge.popular {
    background-color: #2563eb;
}

.card-badge.new {
    background-color: #16a34a;
}

/* === LOGO TWO-LINE LAYOUT === */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    margin-left: 8px;
}

.logo-main {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 1.1rem;
        margin-left: 6px;
    }

    .logo-main {
        font-size: 1.1rem;
    }

    .logo-sub {
        font-size: 1.1rem;
        margin-top: 0;
    }

    .header-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        margin-left: 12px;
    }

    .main-header {
        align-items: flex-start;
    }
}

/* ==================== RESPONSIVE STYLES ==================== */
/* Tablet and Larger Mobile Phones */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* All Mobile Devices (Below 768px) */
@media (max-width: 768px) {

    /* Main header overrides for mobile */
    .main-header,
    .main-header.header-transparent {
        background-color: #111827;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        height: 54px;
        min-height: 54px;
        padding: 4px 2vw;
        align-items: center;
        width: 100vw;
        margin: 0;
    }

    body {
        padding-top: 54px;
    }

    .cta-button {
        display: none;
    }

    /* Mobile logo styles */
    .logo {
        align-items: center;
    }

    .header-logo {
        height: 32px;
        margin-right: 5px;
    }

    .logo a {
        text-shadow: none !important;
        font-weight: 700;
        font-size: 1.5rem;
        white-space: nowrap;
        display: inline-block;
    }

    /* Mobile navigation menu styles */
    .main-nav {
        position: fixed;
        z-index: 1500;
        inset: 0 0 0 30%;
        flex-direction: column;
        padding: min(20vh, 10rem) 2rem;
        background: hsl(0 0% 10% / 0.9);
        backdrop-filter: blur(1rem);
        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }

    .main-nav[data-visible="true"] {
        transform: translateX(0%);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 2rem;
    }

    .main-nav a {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .main-nav a:hover,
    .main-nav a.active-page {
        clip-path: none;
    }

    /* Mobile navigation toggle button */
    .mobile-nav-toggle {
        display: block;
        position: absolute;
        right: 1.5rem;
        top: 1.5rem;
    }

    .header-actions {
        margin-right: 3rem;
    }
}

/* Very Small Mobile Phones (Below 576px) */
@media (max-width: 576px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .footer-bottom-bar {
        margin-top: 10px;
        padding-top: 6px;
    }

    .header-logo {
        height: 32px;
        margin-right: 5px;
    }

    .logo a {
        font-size: 1.1rem;
    }

    .main-header .logo {
        align-items: center;
    }

    .main-header .search-icon,
    .main-header .mobile-nav-toggle {
        height: 32px;
        width: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }

    .main-header .header-actions {
        align-items: center;
        margin-right: 0;
    }

    .main-nav {
        top: 54px;
    }
}

/* === FORCE HEADER ACTIONS HORIZONTAL LAYOUT (FIX) === */
.header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    margin-left: 12px !important;
    white-space: nowrap !important;
}

.search-icon,
.mobile-nav-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* === HEADER ACTIONS FLEX FIX & DEBUG === */
.header-actions {
    flex-wrap: nowrap !important;
    min-width: 0 !important;
    width: auto !important;
    background: none !important;
    /* Debug: remove after testing */
}

.main-header {
    min-height: 54px !important;
    height: auto !important;
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 1rem !important;
        max-width: 60vw !important;
        white-space: normal !important;
    }
}

/* === SEARCH BAR COLLAPSE FIX FOR HEADER ACTIONS === */
.header-actions .search-bar {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    display: block !important;
    background: none !important;
}

.header-actions .search-bar.is-active {
    width: 180px !important;
    /* or adjust as needed */
    max-width: 80vw !important;
    opacity: 1 !important;
    padding: 5px 10px !important;
}

/* Remove debug background from .header-actions */
.header-actions {
    background: none !important;
}

/* === FIX: Ensure .mobile-nav-toggle participates in flex layout === */
.mobile-nav-toggle {
    position: static !important;
}