/*
Theme Name: CTC Theme 2025
Theme URI: https://www.ctc-g.com.my/
Author: Mon @ Rui
Author URI: https://rui-ingenuity.com
Description: CTC Theme 2025
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: rgba(255,255,255,1.0);
  backdrop-filter: saturate(180%) blur(12px);
  transition: background 0.25s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0); /* starts without shadow */
}

/* Active scroll state */
header.active {
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

header .menu-btn { font-size: 90%; }
/* ----------------------------------------------------------------- */
/* ACTIVE STATE LOGIC (Fixed Order & Specificity)                   */
/* ----------------------------------------------------------------- */

/* 1. SAFETY RESET (Run this FIRST) */
/* Force reset if WordPress adds .active to a hash link. */
/* This prevents the "all links blue" issue on the homepage. */
header .menu-btn.active[href*="#"] {
    color: inherit !important;
}
header .menu-btn.active[href*="#"]::after {
    display: none !important;
}

/* 2. STANDARD PAGES (About, Contact, etc.) */
/* Apply styling to active links that DO NOT contain a hash (#) */
header .menu-btn.active:not([href*="#"]) { 
    color: #0087cc !important; 
}
header .menu-btn.active:not([href*="#"])::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 6px solid currentColor; 
    border-left: 6px solid transparent;
}

/* 3. SCROLL SPY (Homepage Sections - Run this LAST) */
/* We add [href*="#"] to the selector to ensure it matches the specificity of the reset rule */
header .menu-btn.gsap-active,
header .menu-btn.gsap-active[href*="#"] { 
    color: #0087cc !important; 
}

header .menu-btn.gsap-active::after,
header .menu-btn.gsap-active[href*="#"]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 6px solid currentColor; 
    border-left: 6px solid transparent;
    
    /* CRITICAL FIX: Override the display:none from the Safety Reset */
    display: block !important; 
}

/* 4. HOVER STATE (The Fix) */
/* Ensures hover works on EVERYTHING, overriding the safety reset */
header .menu-btn:hover,
header .menu-btn.active[href*="#"]:hover,
header .menu-btn.mega-open {
    color: #0087cc !important; 
}
header .menu-btn:hover::after,
header .menu-btn.active[href*="#"]:hover::after,
header .menu-btn.mega-open::after {
    content: '';
    position: absolute;
    top: 0; right: 0; width: 0; height: 0;
    border-top: 6px solid currentColor; 
    border-left: 6px solid transparent;
    display: block !important; 
}

.menu-panel {transition: opacity 0.3s ease, transform 0.3s ease; font-size: 90%; }
.menu-panel.hidden {opacity:0; transform: translateY(10px);} 
.menu-panel.visible {opacity:1; transform: translateY(0);}
.menu-panel li > a:hover { color: var(--color-primary); }
/* Mobile submenu animation */
/* 1. Reset standard links to have consistent spacing */
#mobileMenu > a {
    display: block;
    padding-top: 0.35rem;    /* py-3 equivalent */
    padding-bottom: 0.35rem; /* py-3 equivalent */
}

/* 2. Fix the Accordion Button to match exact height of links */
.mobile-acc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  /* OVERRIDE your previous padding here */
  padding: 0.35rem 0 !important; 
  text-align: left;
  font-size: 0.8em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 28px;
}
.mobile-submenu {
  /* Critical for the "push down" effect */
  display: block; 
  overflow: hidden; 

  /* Start closed */
  max-height: 0; 
  opacity: 0;

  /* Smooth animation for push effect */
  transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;

  /* Indentation and Spacing */
  padding-left: 1rem; 
  margin-top: 0; /* JS will toggle this if needed, but 0 is safer start */
}
/* 3. Submenu Links (Indented) */
.mobile-submenu a {
    display: block;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    color: #4b5563; /* Gray-600 */
    font-size: 0.85em;
}

#mobileMenu > a {
  font-size: 0.8em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 28px;
}
/* 4. Remove divider from last item */
#mobileMenu > a:last-child {
  border-bottom: none;
}

/* 1. Highlight the specific active link (Child or Parent) */
#mobileMenu a.mobile-active {
  color: #0087cc !important; /* Primary Blue */
}
/* 2. Highlight the Parent Accordion Button when child is active */
.mobile-acc.child-active {
    color: #0087cc !important;
}

/* Ensure the plus icon is centered vertically */
.plus-icon {
  top: auto; /* Reset */
  transform: none;
  display: block; position: relative; width: 28px; height: 28px;
}
.plus-icon span:nth-child(1), .plus-icon span:nth-child(2) {
  display: block;
  position: absolute;
  background: #000000;
  -moz-transition: all .25s ease;
  -webkit-transition: all .25s ease;
  -o-transition: all .25s ease;
  transition: all .25s ease;
}
.plus-icon span:nth-child(1) {
  width: 16px;
  height: 2px;
  margin: 0 6px;
  /*- half the height*/
  top: calc(50% - 1px);
}
.plus-icon span:nth-child(2) {
  width: 2px;
  height: 16px;
  margin: 6px 0;
  /*- half the width*/
  left: calc(50% - 1px);
}
.plus-icon.open span:nth-child(2) {
  -moz-transform: rotate(-90deg);
  -webkit-transform: rotate(-90deg);
  -o-transform: rotate(-90deg);
  transform: rotate(-90deg);
}

/* Utility for vertical text */
.vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
}
/* Hide scrollbar for cleaner look in diagrams */
.no-scrollbar::-webkit-scrollbar {
  height: 6px;
}
.no-scrollbar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.no-scrollbar::-webkit-scrollbar-track {
  background-color: #f1f5f9;
}

.fade-in-up { animation: fadeInUp 0.8s ease-out forwards; opacity: 0; transform: translateY(20px); }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* UPDATED: Dynamic Scale Animation instead of Fixed Height */
@keyframes scaleVertical {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.animate-scale-vertical {
    animation: scaleVertical 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Hero Background Effect */
.hero-bg {
    background-color: #0B1120; /* Darker Slate/Blue */
    position: relative;
    overflow: hidden;
}

/* Tech Grid Pattern */
.tech-grid {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Nav Link Styles */
.sidebar-link {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}
.sidebar-link:hover {
    border-left-color: #7dd3fc;
    color: #0087cc;;
    background: linear-gradient(to right, #f8fafc, transparent);
}
.sidebar-link.active {
    border-left-color: #0087cc;
    color: #0087cc;;
    font-weight: 600;
}

/* WHY CTC */
/* Smooth transition for the details card */
#branch-details-card {
    transition: all 0.3s ease-in-out;
}

/* Modern Minimalist Branch List Item */
.branch-item {
    position: relative;
    padding-left: 1rem;
    transition: all 0.2s ease;
}

.branch-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background-color: var(--color-primary); /* Primary Blue */
    transition: height 0.2s ease;
    border-radius: 99px;
}

.branch-item:hover {
    background-color: #f8fafc; /* Slate 50 */
    color: var(--color-primary);
}

/* Active State: Full height bar and distinct color */
.branch-item.active {
    background-color: var(--color-primary-50); /* Blue 50 */
    color: var(--color-primary);
    font-weight: 600;
}

.branch-item.active::before {
    height: 70%;
}

/***** JOB POSITIONS *****/
.job-card { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.job-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); border-color: #38bdf8; }
.pagination-btn.active { background-color: #009fe3; color: white; border-color: #009fe3; }
