/* KARAN AL JUBAIL CONTRACTING EST.
   Main Stylesheet
   This file is now connected to the variables in setting.php
*/

/* ===== 1. CSS Variables & Global Reset ===== */
:root {
    /* These values are placeholders. They are OVERRIDDEN 
       by the settings in includes/header.php */
    --primary-color: #C96D14;
    --dark-color: #272957;      /* Linked to: settings_dark_color */
    --text-color: #333333;
    --heading-color: #111111;   /* Linked to: settings_heading_color */
    --top-bar-bg: #f8f9fa;      /* Linked to: settings_top_bar_bg */
    --footer-bg: #272957;       /* Linked to: settings_footer_bg */

    /* These are internal theme variables, not in settings panel */
    --light-blue: #007bff;
    --text-light: #666666;
    --white-color: #ffffff;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --font-heading: 'Teko', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color); /* DYNAMIC */
    background-color: var(--white-color);
    /* FIX 2: Removed "padding-bottom: 70px;" 
       This was causing the white space on desktop.
       The correct padding is applied in the mobile styles.
    */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading-color); /* DYNAMIC */
    font-weight: 600;
    margin-bottom: 15px;
}

h1 { font-size: 48px; }
h2 { font-size: 36px; line-height: 1.2; }
h3 { font-size: 24px; }

a {
    text-decoration: none;
    color: var(--primary-color); /* DYNAMIC */
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-color); /* DYNAMIC */
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: capitalize;
}

.btn-primary {
    background-color: var(--primary-color); /* DYNAMIC */
    color: var(--white-color);
    border: 2px solid var(--primary-color); /* DYNAMIC */
}

.btn-primary:hover {
    background-color: var(--dark-color); /* DYNAMIC */
    border-color: var(--dark-color); /* DYNAMIC */
    color: var(--white-color);
}

/* ===== 2. Header Styles ===== */

/* Top Bar (Light Grey) */
.top-bar {
    background-color: var(--top-bar-bg); /* DYNAMIC */
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-light);
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-info i {
    color: var(--primary-color); /* DYNAMIC */
    margin-right: 8px;
}
.top-bar-social a {
    margin-left: 15px;
    color: var(--text-light);
    font-size: 16px;
}
.top-bar-social a:hover {
    color: var(--primary-color); /* DYNAMIC */
}

/* Header Middle (White Area) */
.header-middle {
    padding: 20px 0;
    background: var(--white-color);
}
.header-middle-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    height: 65px;
}
.header-contact-info {
    display: flex;
    gap: 25px;
}
.info-box {
    display: flex;
    align-items: center;
    gap: 12px;
}
.info-box .icon {
    font-size: 24px;
    color: var(--primary-color); /* DYNAMIC */
}
.info-box .text {
    display: flex;
    flex-direction: column;
}
.info-box .text strong {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--heading-color); /* DYNAMIC */
    font-size: 16px;
}
.info-box .text span {
    font-size: 14px;
    color: var(--text-light);
}

/* Main Header (Dark Blue Nav) */
.main-header {
    background-color: var(--dark-color); /* DYNAMIC */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-links {
    list-style: none;
    display: flex;
}
.nav-links li {
    margin-right: 35px;
}
.nav-links a {
    color: var(--white-color);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 17px;
    padding: 20px 0;
    position: relative;
    display: block;
}
.nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background: var(--primary-color); /* DYNAMIC */
    transition: width 0.3s;
    position: absolute;
    bottom: 10px;
    left: 0;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}
.header-right {
    display: flex;
    align-items: center;
}
.mobile-menu-button {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--dark-color); /* DYNAMIC */
    font-size: 28px;
    cursor: pointer;
}

/* ===== 3. Page Sections ===== */
.page-section {
    padding: 80px 0;
}
.bg-light {
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-title h2 {
    font-size: 40px;
    margin-bottom: 10px;
}
.section-title p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}
.section-title-icon {
    font-size: 24px;
    color: var(--light-blue);
    display: block;
    margin-bottom: 10px;
}
.section-title.text-center {
    text-align: center;
}

/* Page Header Banner */
.page-header {
    position: relative;
    padding: 80px 0;
    background-size: cover;
    background-position: center;
    text-align: center;
    color: var(--white-color);
}
.page-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(39, 41, 87, 0.8); /* This is the hard-coded overlay from the theme, using --dark-color's original value */
}
.page-header .container {
    position: relative;
    z-index: 2;
}
.page-header h1 {
    color: var(--white-color);
    font-size: 50px;
    margin-bottom: 10px;
}
.breadcrumb {
    list-style: none;
    display: flex;
    justify-content: center;
    font-size: 16px;
}
.breadcrumb li {
    margin: 0 5px;
}
.breadcrumb li:after {
    content: '/';
    margin-left: 10px;
}
.breadcrumb li:last-child:after {
    display: none;
}
.breadcrumb a {
    color: var(--white-color);
}
.breadcrumb a:hover {
    color: var(--primary-color); /* DYNAMIC */
}

/* ===== 4. Homepage Styles ===== */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-color: var(--dark-color); /* DYNAMIC */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(39, 41, 87, 0.7); /* This is the hard-coded overlay from the theme */
}
.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white-color);
    max-width: 800px;
}
.hero-content h1 {
    font-size: 60px;
    font-weight: 700;
    color: var(--white-color);
    margin-bottom: 20px;
    line-height: 1.1;
}
.hero-content h1 span {
    color: var(--primary-color); /* DYNAMIC */
}
.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
}

.about-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.about-preview-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.about-preview-content h3 {
    color: var(--primary-color); /* DYNAMIC */
    font-weight: 500;
    font-family: var(--font-body);
}
.about-preview-content h2 {
    margin-bottom: 20px;
}
.about-preview-content p {
    margin-bottom: 20px;
}

/* Homepage Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.service-card {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.service-card-image {
    height: 220px;
    width: 100%;
    object-fit: cover;
}
.service-card-content {
    padding: 30px 25px;
}
.service-card-content h3 {
    font-size: 22px;
}
.service-card-content p {
    margin-bottom: 15px;
}
.service-card-content .btn {
    font-size: 14px;
    padding: 8px 20px;
    margin-top: 15px;
}

/* Client Logos (Homepage & Clients Page) */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    align-items: center;
}
.client-logo-box {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    transition: all 0.3s ease;
    background: var(--white-color);
}
.client-logo-box:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    transform: translateY(-5px);
}
.client-logo-box img {
    max-width: 100%;
    max-height: 80px;
    height: auto;
    object-fit: contain;
}
.clients-grid.full-page-grid {
    grid-template-columns: repeat(4, 1fr); 
}

/* ===== 5. About Page ===== */
.about-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.about-page-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.about-page-content h3 {
    color: var(--primary-color); /* DYNAMIC */
    font-weight: 500;
    font-family: var(--font-body);
}
.about-page-content h2 {
    margin-bottom: 20px;
}
.vision-mission {
    margin-top: 30px;
}
.vm-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}
.vm-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--primary-color); /* DYNAMIC */
    color: var(--white-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
}
.vm-card:last-child .vm-icon {
    background: var(--dark-color); /* DYNAMIC */
}
.vm-content h3 {
    font-size: 22px;
    color: var(--heading-color); /* DYNAMIC */
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

/* ===== 6. Services Page (NEW SINGLE-COLUMN DESIGN) ===== */
.services-list-new {
    display: grid;
    grid-template-columns: 1fr; /* Single column */
    gap: 30px;
    max-width: 800px; /* Center the list */
    margin: 0 auto;
}
.service-list-card {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease-in-out;
    position: relative;
    padding-left: 100px; /* Space for the icon */
    min-height: 120px;
    display: flex;
    align-items: center;
}
.service-list-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.service-list-image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1; /* Faded background image */
}
.service-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.service-list-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--dark-color); /* DYNAMIC */
    color: var(--white-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    z-index: 2;
    border: 4px solid var(--white-color);
}
.service-list-content {
    padding: 25px 20px;
    position: relative; /* Ensure it's above the image */
    z-index: 1;
}
.service-list-content h3 {
    font-size: 24px;
    margin: 0;
    color: var(--heading-color); /* DYNAMIC */
}

/* ===== 7. Trading Page ===== */
.trading-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.trading-card-new {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
}
.trading-card-new:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.trading-icon-new {
    width: 70px;
    height: 70px;
    background: var(--light-blue);
    color: var(--white-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    margin: 0 auto 20px;
}
.trading-card-new h3 {
    font-size: 22px;
    color: var(--heading-color); /* DYNAMIC */
    margin-bottom: 25px;
}
.trading-list-new {
    list-style: none;
    text-align: left;
    display: inline-block;
    margin: 0;
    padding: 0;
}
.trading-list-new li {
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 16px;
}
.trading-list-new i.fa-check {
    color: var(--light-blue);
    margin-right: 10px;
}

/* ===== 8. Contact Page ===== */
.contact-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.contact-form-new {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
}
.contact-form-title {
    font-size: 28px;
    color: var(--heading-color); /* DYNAMIC */
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color); /* DYNAMIC */
}
.contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.form-group {
    width: calc(50% - 10px);
    margin-bottom: 0;
}
.form-group.full-width {
    width: 100%;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 16px;
}
.form-group textarea {
    min-height: 120px;
    resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color); /* DYNAMIC */
    box-shadow: 0 0 5px rgba(201, 109, 20, 0.5);
}
.contact-form-new .form-group {
    margin-bottom: 0;
}

.contact-info-bar {
    padding-top: 0;
    padding-bottom: 80px;
}
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.contact-info-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: var(--light-bg);
    padding: 25px;
    border-radius: 8px;
}
.contact-info-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--dark-color); /* DYNAMIC */
    color: var(--white-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
}
.contact-info-content h3 {
    font-size: 20px;
    color: var(--heading-color); /* DYNAMIC */
    margin: 0 0 5px;
}
.contact-info-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-light);
}

/* ===== 9. Footer ===== */
.site-footer {
    background-color: var(--footer-bg); /* DYNAMIC */
    color: #a9b3d0;
    padding-top: 70px;
    font-size: 15px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}
.footer-logo {
    height: 50px;
    margin-bottom: 20px;
}
.footer-col h3 {
    color: var(--white-color);
    font-size: 22px;
    margin-bottom: 25px;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: #a9b3d0;
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--primary-color); /* DYNAMIC */
    padding-left: 5px;
}
.footer-contact li {
    list-style: none;
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}
.footer-contact i {
    color: var(--primary-color); /* DYNAMIC */
    font-size: 18px;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}
.footer-social {
    margin-top: 20px;
}
.footer-social a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white-color);
    margin-right: 5px;
}
.footer-social a:hover {
    background: var(--primary-color); /* DYNAMIC */
}
.copyright-bar {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    color: #a9b3d0;
    font-size: 14px;
}

/* ===== 10. NEW Mobile Fixed Elements ===== */

/* Back to Top Button */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 80px; /* 10px above the mobile footer */
    right: 15px;
    z-index: 999;
    background-color: var(--primary-color); /* DYNAMIC */
    color: var(--white-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.back-to-top:hover {
    background-color: var(--dark-color); /* DYNAMIC */
    color: var(--white-color);
}

/* Mobile Fixed Footer Bar */
.mobile-fixed-footer {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--white-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
.mobile-fixed-footer a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 25%; /* 4 buttons */
    height: 100%;
    color: var(--text-light);
    font-size: 12px;
}
.mobile-fixed-footer a i {
    font-size: 20px;
    margin-bottom: 3px;
}
.mobile-fixed-footer a:hover {
    color: var(--primary-color); /* DYNAMIC */
}

/* ===== 11. Image Lazy Loading Effect ===== */
.lazy-image {
    background-color: #f0f0f0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.lazy-image.loaded {
    opacity: 1;
}

/* ===== 12. RESPONSIVE (Mobile) STYLES ===== */

/* Tablets and smaller (992px) */
@media (max-width: 992px) {
    /* --- Header --- */
    .header-contact-info {
        display: none; /* Hide desktop contact info */
    }
    .main-header {
        display: none; /* Hide the entire blue nav bar */
    }
    .mobile-menu-button {
        display: block; /* Show hamburger button */
    }

    /* --- Mobile Nav Menu (Sliding) --- */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -100%; /* Start off-screen */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--dark-color); /* DYNAMIC */
        padding: 20px;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
        transition: left 0.3s ease-in-out;
        z-index: 1001;
    }
    .nav-links.active {
        left: 0; /* Slide in */
    }
    .nav-links li {
        margin: 0;
        width: 100%;
    }
    .nav-links a {
        padding: 15px 10px;
        width: 100%;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links a::after {
        display: none;
    }

    /* --- Grids --- */
    .services-grid, 
    .footer-grid,
    .services-grid-new,
    .trading-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-preview-grid,
    .about-page-grid {
        grid-template-columns: 1fr;
    }
    .clients-grid,
    .clients-grid.full-page-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .contact-page-grid,
    .contact-info-grid {
        grid-template-columns: 1fr;
    }
    
    .services-list-new {
        grid-template-columns: 1fr; /* Already 1 column, but good to be explicit */
    }
}

/* Mobile phones (576px) */
@media (max-width: 576px) {
    /* Hide desktop footer, show mobile bar */
    .site-footer {
        display: none;
    }
    .mobile-fixed-footer {
        display: flex;
    }
    
    /* Make body padding 0 for mobile, let content handle it */
    body {
        padding-bottom: 60px; /* Space for the fixed footer */
    }

    .top-bar-content {
        flex-direction: column;
        gap: 10px;
    }
    .header-middle {
        padding: 15px 0;
    }
    .logo img {
        height: 50px;
    }
    .header-contact-info {
        display: none;
    }

    .hero-content h1 {
        font-size: 40px;
    }
    .hero-content p {
        font-size: 16px;
    }

    /* --- Grids (Stack all to 1 column) --- */
    .services-grid, 
    .services-grid-new,
    .clients-grid,
    .clients-grid.full-page-grid,
    .trading-grid-new,
    .footer-grid { /* Added footer grid */
        grid-template-columns: 1fr;
    }
    
    .form-group {
        width: 100%;
    }
    
    .service-list-card {
        padding-left: 0;
        padding-top: 90px;
        min-height: auto;
    }
    .service-list-icon {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
    }
}