:root {
  --shimadzu-red: #dd0000;
  --text-dark: #333333;
  --text-light: #666666;
  --bg-light: #f5f5f5;
  --bg-gray: #f9f9f9;
  --border-color: #e5e5e5;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background-color: #fff;
}

.training-detail-page {
  /* overflow-x: hidden; */ /* Disable to allow breakout */
}

.full-width-section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Helpers */
.visible-mobile { display: none !important; }
.visible-desktop { display: block !important; }

@media (max-width: 991px) {
  .visible-mobile { display: block !important; }
  .visible-desktop { display: none !important; }
}

/* Hero Banner */
.course-hero {
  position: relative;
  height: auto;
  min-height: 180px;
  background-color: #f5f5f5; /* Gray background */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: var(--text-dark);
  padding-top: 20px;
  padding-bottom: 20px;
  
  /* Breakout Styles */
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.course-hero::before {
  display: none;
}

.course-hero-content {
  position: relative;
  z-index: 1;
  padding-bottom: 20px;
  width: 100%;
}

.course-hero-top {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: initial;
  margin: initial;
  /* Ensure this acts as a container since we removed padding from hero */
  /* But in HTML we will add .container class back, so this is just flex props */
}

.course-breadcrumbs {
  margin-bottom: 20px;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: #666;
}

.breadcrumb-list li {
  margin-right: 5px;
}

.breadcrumb-list li::after {
  content: '/';
  margin-left: 5px;
  color: #999;
}

.breadcrumb-list li:last-child::after {
  content: '';
}

.breadcrumb-list a {
  color: #666;
  text-decoration: none;
}

.course-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: left;
  color: #333;
  text-shadow: none; /* Removed text shadow */
}

.course-action-buttons {
  display: flex;
  justify-content: flex-end; /* Align right */
  gap: 15px;
  margin-top: auto;
  /* padding-bottom: 20px; */ /* Moved to hero padding */
}

.btn-hero-action {
  display: inline-table;
  text-decoration: none;
  position: relative;
  cursor: pointer;
  line-height: 1.2;
  border-radius: 999px; /* Pill shape */
  background-color: #fff;
  border: 1px solid var(--shimadzu-red);
  color: var(--shimadzu-red);
  transition: all 0.3s;
  min-height: 22px;
  
  /* Text alignment and sizing from .p-inquiryButton__text */
  vertical-align: middle;
  text-align: center;
  min-width: 120px;
  padding: 3px 15px;
  font-size: 1.2rem;
}

.btn-hero-action:hover {
  background-color: var(--shimadzu-red);
  color: white;
}

/* Sticky Navigation */
.sticky-nav-wrapper {
  position: relative !important;
  top: auto !important;
  z-index: 10;
  background: white;
  /* box-shadow: 0 2px 10px rgba(0,0,0,0.1); */ /* Removed shadow separator */
  transition: all 0.3s ease;
  border-bottom: none;
  
  /* Also apply breakout to nav wrapper if needed */
  width: 100vw !important;
}

.sticky-nav-wrapper .container {
  /* border-bottom: 1px solid #e5e5e5; */
}

.sticky-nav {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0; /* No gap between items */
}

.sticky-nav li {
  margin: 0;
}

.sticky-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 70px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 16px;
  
  /* Default State: 1px border all around */
  border: 1px solid #e5e5e5;
  
  margin: 20px 0; /* Vertical margin */
  background: white;
  transition: all 0.1s;
  gap: 10px;
  position: relative;
  margin-right: -1px; /* Overlap borders */
}

.sticky-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background-color: var(--shimadzu-red);
  display: none;
  z-index: 2;
}

.sticky-nav a:hover::after,
.sticky-nav a.active::after {
  display: block;
}

.sticky-nav li:first-child a {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sticky-nav li:last-child a {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
}


.sticky-nav a img {
  height: 20px;
  width: auto;
}

.sticky-nav a:hover,
.sticky-nav a.active {
  color: var(--shimadzu-red);
  z-index: 1; /* Bring to front */
}

/* Section Styles */
.course-section {
  padding: 40px 0; /* Reduced top padding for sections */
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 30px;
  margin-top: 30px;
  position: relative;
}

/* Basic Info Section */
.basic-info-section {
  background: white;
  padding-top: 30px; /* Even smaller top padding */
}

.basic-info-container {
  display: flex;
  gap: 30px;
}

.basic-info-text {
  flex: 0 0 70%; /* Reduced from 65% */
  display: flex;
  flex-direction: column;
}

.basic-info-image {
  flex: 0 0 25%; /* Reduced from 65% */
  background: white; 
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e5e5; /* Gray border */
  padding: 5px; /* Padding for border */
  /* border-radius: 4px; */
  overflow: hidden;
  height: auto; 
  align-self: flex-start; /* Don't stretch */
  text-align: center;
}

.basic-info-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.info-list {
  margin-bottom: 30px;
}

/* Check Schedule Button (Desktop) */
.btn-check-schedule-desktop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 70px; /* Larger width */
  border: 1px solid #ccc;
  background: white;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.3s;
  font-size: 14px;
  align-self: flex-start;
  gap: 10px; /* Space between icon and text */
}

.btn-check-schedule-desktop img {
  height: 16px;
  width: auto;
  order: -1; /* Icon first */
}

.btn-check-schedule-desktop .icon-hover {
  display: none;
}

.btn-check-schedule-desktop:hover .icon-normal {
  display: none;
}

.btn-check-schedule-desktop:hover .icon-hover {
  display: block;
}

.btn-check-schedule-desktop:hover {
  background: var(--shimadzu-red);
  color: white;
  border-color: var(--shimadzu-red);
}

/* Content & Background Sections */
.content-section .content-text {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 16px;
  text-align: justify;
}

/* Schedule Section */
.schedule-section {
  background-color: white;
}

.schedule-tabs {
  display: flex;
  justify-content: center;
  gap: 30px; /* PC Gap */
  margin-bottom: 40px;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px; /* Larger width */
  padding: 10px 0; /* Smaller height */
  background: white;
  border: 1px solid #ccc;
  border-radius: 0;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  transition: all 0.3s;
  gap: 10px;
}

.tab-btn img {
  height: 20px;
  width: auto;
}

.tab-btn .icon-active { display: none; }
.tab-btn .icon-inactive { display: block; }

.tab-btn.active {
  color: var(--shimadzu-red);
  border-color: var(--shimadzu-red);
}

.tab-btn.active .icon-active { display: block; }
.tab-btn.active .icon-inactive { display: none; }

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Schedule List Table (PC) */
.schedule-table-wrapper {
  margin-bottom: 30px;
  width: 66.66%; /* 2/3 width */
  margin-left: auto;
  margin-right: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
  border-left: none;
  border-right: none;
}

.schedule-table th {
  background-color: #333;
  color: white;
  padding: 10px 15px; /* Smaller padding */
  text-align: center;
  font-weight: normal;
  font-size: 14px;
}

.schedule-table td {
  padding: 10px 15px; /* Smaller padding */
  border-bottom: 1px solid #ddd;
  text-align: center;
  color: #000;
  vertical-align: middle;
  font-size: 14px;
  white-space: nowrap; /* No wrapping */
}

.schedule-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.schedule-table tr.fontHui td {
  color: var(--text-light);
}

.btn-table-apply {
  color: var(--shimadzu-red);
  text-decoration: none;
  font-size: 14px;
  font-weight: normal;
}

.btn-table-apply:hover {
  text-decoration: underline;
}

.btn-table-apply.disabled {
  color: #ccc;
  cursor: default;
  text-decoration: none;
}

/* Search Form (PC) */
.search-form-container {
  background: #f5f5f5; /* Light gray bg */
  padding: 40px;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
}

#schedule-search-form .form-row {
  display: flex;
  justify-content: center;
  align-items: center; /* Vertically centered */
  gap: 20px;
  margin-bottom: 30px;
}

#schedule-search-form .select-block {
  flex: 0 0 40%;
  position: relative;
  display: flex;
  flex-direction: column; /* Label on top */
  align-items: flex-start; /* Left align */
  gap: 10px;
}

#schedule-search-form label {
  font-size: 16px; /* Larger font */
  font-weight: bold;
  white-space: nowrap;
}

/* Custom Select Arrow */
#schedule-search-form .select-wrapper {
  position: relative;
  width: 100%; /* Full width of container */
}

#schedule-search-form .select-wrapper::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-20%); /* Adjust arrow position */
  border: 6px solid transparent;
  border-top-color: #666;
  pointer-events: none;
}

#schedule-search-form .form-control {
  width: 100%;
  height: 40px; /* Smaller height */
  padding: 0 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 14px;
  color: #666;
  background: white;
}

.form-actions {
  text-align: center;
}

.btn-search-submit {
  background-color: var(--shimadzu-red);
  color: white;
  border: none;
  padding: 10px 60px; /* Smaller height, larger width */
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.3s;
}

.btn-search-submit img {
  height: 18px;
  width: auto;
}

.btn-search-submit:hover {
  background-color: #a00018;
}

.other-course-link {
  text-align: center;
  margin-top: 30px; /* Moved outside */
}

.other-course-link a {
  color: #999;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
  display: inline-block;
}

/* ================= Mobile Styles ================= */
@media (max-width: 991px) {
  .course-hero {
    display: none !important; /* Hide hero banner on mobile */
  }
  
  .sticky-nav-wrapper {
    /* Ensure nav is not sticky and has proper z-index */
    position: relative !important;
    top: auto !important;
    z-index: 10;
    margin-top: 20px;
  }

  .sticky-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    /* Ensure it doesn't overlap with header if any */
  }
  
  .sticky-nav a {
    flex-direction: column;
    border: 1px solid #e5e5e5;
    padding: 10px 5px;
    font-size: 12px;
    margin: 0;
    height: 100%;
    /* Default state: transparent bottom border to reserve space */
    /* border-bottom: 3px solid transparent;  */
    padding-bottom: 7px; /* 10px total bottom spacing */
    background: white;
    color: var(--text-dark);
  }
  
  .sticky-nav a:hover,
  .sticky-nav a.active {
    color: var(--shimadzu-red);
    border-top-color: #e5e5e5;
    border-left-color: #e5e5e5;
    border-right-color: #e5e5e5;
    border-bottom: 3px solid var(--shimadzu-red);
    padding-bottom: 7px; /* Keep padding consistent to avoid jitter */
  }

  /* Mobile Title & Button */
  .mobile-course-header {
    text-align: center;
    padding: 20px 15px;
    background: white;
  }

  .mobile-course-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-dark);
  }

  .btn-mobile-schedule-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60%; /* 3/5 width */
    margin: 0 auto;
    background-color: var(--shimadzu-red);
    color: white !important;
    padding: 10px 0;
    border-radius: 0;
    text-decoration: none;
    font-size: 14px;
    gap: 8px;
  }

  .btn-mobile-schedule-main img {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1); /* Make icon white */
  }

  /* Section Titles */
  .section-title {
    font-size: 24px; /* Increased from 18px */
    margin-top: 0; /* Reduced from 20px to 0 */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--shimadzu-red); /* Red underline */
    display: inline-block; /* Keep inline-block for underline width if needed, or change to block */
    width: 100%; 
    text-align: center; /* Centered */
    padding-left: 0;
  }
  
  /* Remove gray border from course sections on mobile and reduce spacing */
  .course-section {
    border-bottom: none;
    padding: 10px 0; /* Reduced from 40px to 10px */
  }

  /* Content Width Matching Nav */
  .basic-info-container, 
  .content-block {
    /* Container already has padding, content should naturally align */
    padding: 0; 
  }
  
  .basic-info-text,
  .basic-info-image,
  .mobile-schedule-btn-wrapper {
    display: none !important; /* Hide old mobile elements if replacing */
  }
  
  /* Re-enable basic info text but hide image/button wrapper inside it */
  .basic-info-text {
    display: block !important;
    width: 100%;
    flex: 0 0 100%;
  }
  
  /* Hide desktop/old mobile specific elements inside basic info */
  .basic-info-text .desktop-schedule-btn-wrapper,
  .mobile-schedule-btn-wrapper {
    display: none !important;
  }

  /* Info List Styling */
  .info-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 14px;
  }
  
  .info-label {
    font-weight: bold;
    min-width: 80px;
  }

  /* Schedule Tabs */
  .schedule-tabs {
        gap: 10px;
        width: 80%;
        margin: 0 auto;
        margin-bottom: 20px;
    }
  
  .tab-btn {
    width: auto;
    flex: 1;
    padding: 8px 0;
    font-size: 14px;
  }
  
  .tab-btn img {
    height: 16px;
  }

  /* Schedule Table */
  .schedule-table-wrapper {
    width: 100%;
    overflow-x: auto;
  }
  
  .schedule-table th, 
  .schedule-table td {
    padding: 8px 5px;
    font-size: 12px;
    white-space: normal; /* Allow wrapping on mobile */
  }

  /* Search Form */
  .search-form-container {
    padding: 20px;
  }
  
  #schedule-search-form label {
    display: none; /* Hide labels */
  }
  
  #schedule-search-form .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  #schedule-search-form .select-block {
    width: 100%;
    flex: 0 0 100%;
  }
  
  .btn-search-submit {
    /* width: 70%; */
    justify-content: center; /* Center content */
    margin: 0 auto;
    display: flex;
    border-radius: 0;
  }
}
