/* ===== YPANÉ FM - Header Styles ===== */

/* --- CSS Variables --- */
:root {
  --ypane-orange: #e65100;
  --ypane-orange-dark: #bf360c;
  --ypane-blue: #1a2ca8;
  --bg-body: #ffffff;
  --bg-card: #ffffff;
  --bg-secondary: #f4f4f4;
  --bg-header: #ffffff;
  --bg-topbar: #1a1a2e;
  --bg-menu: #e65100;
  --text-main: #333333;
  --text-secondary: #666666;
  --text-inverse: #ffffff;
  --text-header-date: #444444;
  --border-color: #eeeeee;
  --border-input: #cccccc;
}

[data-theme="dark"] {
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --bg-secondary: #2d2d2d;
  --bg-header: #1a1a1a;
  --bg-topbar: #000000;
  --bg-menu: #bf360c;
  --text-main: #ffffff;
  --text-secondary: #eeeeee;
  --text-inverse: #121212;
  --text-header-date: #dddddd;
  --border-color: #333333;
  --border-input: #444444;
}

/* Dark mode overrides */
[data-theme="dark"] body {
  background-color: var(--bg-body);
  color: var(--text-main);
}

[data-theme="dark"] .header-socials a,
[data-theme="dark"] #search-trigger,
[data-theme="dark"] .mobile-toggle {
  color: #ffffff !important;
}

[data-theme="dark"] .header-weather {
  color: #ff9800 !important;
}

[data-theme="dark"] .weather-panel {
  background: #2d2d2d;
}

[data-theme="dark"] .weather-panel-header {
  background: var(--ypane-orange);
}

[data-theme="dark"] .forecast-day {
  background: #383838;
}

[data-theme="dark"] .forecast-day-name {
  color: #ddd;
}

[data-theme="dark"] .temp-max {
  color: #fff;
}

[data-theme="dark"] .forecast-icon {
  color: #ff9800;
}

[data-theme="dark"] .search-form {
  background: #2d2d2d;
  border-color: #444;
}

[data-theme="dark"] .search-form input {
  color: #fff;
}

[data-theme="dark"] .search-form input::placeholder {
  color: #bbb;
}

/* --- Container handled by standard Bootstrap .container --- */
.header-wrapper .main-wrapper {
  padding-top: 0 !important;
}

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

/* --- Top Bar --- */
#top-bar {
  background-color: #000;
  padding: 8px 0;
  color: #4da6ff;
  font-size: 13px;
  font-weight: 500;
}

.top-info {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  align-items: center;
  width: 100%;
}

.top-info span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-info .fa-phone {
  color: #fca311;
  font-size: 14px;
}

.top-info .fa-whatsapp {
  color: #25d366;
  font-size: 14px;
}

.social-top-inline {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.social-top-inline a {
  color: #4da6ff;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 12px;
}

.social-top-inline a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  #top-bar {
    display: none;
  }
}

/* --- Theme Pill Switch --- */
.theme-pill-container {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #000;
  border: 1px solid #333;
  border-radius: 20px;
  width: 160px;
  height: 34px;
  margin-left: 15px;
  cursor: pointer;
  overflow: hidden;
}

.pill-option {
  flex: 1;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  transition: color 0.3s ease;
  user-select: none;
  height: 100%;
}

.pill-option i {
  font-size: 13px;
}

.pill-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background-color: #fff;
  border-radius: 18px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.theme-pill-container.dark-active #opt-dark,
.theme-pill-container.dark-active [data-value="dark"] {
  color: #000;
}

.theme-pill-container.dark-active #opt-light,
.theme-pill-container.dark-active [data-value="light"] {
  color: #888;
}

.theme-pill-container.dark-active .pill-slider {
  transform: translateX(0);
}

.theme-pill-container.light-active #opt-dark,
.theme-pill-container.light-active [data-value="dark"] {
  color: #888;
}

.theme-pill-container.light-active #opt-light,
.theme-pill-container.light-active [data-value="light"] {
  color: #000;
}

.theme-pill-container.light-active .pill-slider {
  transform: translateX(100%);
}

/* --- Logo Section --- */
#logo-section {
  background-color: #f1503d;
  padding: 15px 15px;
  border-bottom: 1px solid var(--border-color);
}

.top-info-wrapper {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.main-header-grid {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

.header-left {
  display: flex !important;
  flex-direction: column !important;
  font-size: 13px !important;
  color: var(--text-header-date) !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  text-align: left !important;
  position: relative !important;
}

.header-date {
  margin-bottom: 5px;
  text-transform: capitalize;
}

.header-weather {
  font-weight: bold;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
}

.header-center {
  flex: 0 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;
  position: relative !important;
}

.main-logo {
  height: 95px;
  width: auto;
  max-width: 100%;
  display: block;
}

.header-right {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  justify-content: flex-end !important;
  position: relative !important;
}

.follow-text {
  font-size: 11px;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-socials {
  display: flex;
  gap: 12px;
}

.header-socials a {
  color: #333;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s;
}

.header-socials a:hover {
  color: var(--ypane-orange);
}

@media (max-width: 768px) {
  .main-header-grid {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .header-left,
  .header-right {
    width: 100%;
    justify-content: center;
    align-items: center;
  }

  .header-left {
    order: 2;
  }

  .header-center {
    order: 1;
  }

  .header-right {
    order: 3;
  }
}

/* --- Weather Panel --- */
.weather-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 400px;
  margin-top: 10px;
  overflow: hidden;
}

.weather-panel.active {
  display: block;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.weather-panel-header {
  background: var(--ypane-orange);
  color: #fff;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: bold;
}

.forecast-container {
  display: flex;
  padding: 15px;
  gap: 10px;
}

.forecast-loading {
  padding: 30px;
  text-align: center;
  color: #666;
  width: 100%;
}

.forecast-day {
  flex: 1;
  text-align: center;
  padding: 10px 5px;
  background: #f9f9f9;
  border-radius: 6px;
}

.forecast-day-name {
  font-size: 11px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.forecast-icon {
  font-size: 24px;
  color: var(--ypane-orange);
  margin-bottom: 8px;
}

.forecast-temps {
  display: flex;
  justify-content: center;
  gap: 15px;
  font-size: 18px;
  font-weight: bold;
}

.temp-min {
  color: #666;
}

.temp-max {
  color: #222;
}

.forecast-labels {
  display: flex;
  justify-content: center;
  gap: 15px;
  font-size: 10px;
  color: #999;
  margin-top: 3px;
}

@media (max-width: 768px) {
  .weather-panel {
    min-width: 280px;
  }

  .forecast-temps {
    font-size: 14px;
    gap: 10px;
  }

  .forecast-day {
    padding: 8px 3px;
  }

  .forecast-day-name {
    font-size: 9px;
  }
}

/* --- Main Menu --- */
#main-menu {
  background-color: var(--bg-menu);
  font-family: Arial, Helvetica, sans-serif;
  border-bottom: 4px solid var(--ypane-orange-dark);
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-list li a {
  display: block;
  padding: 14px 14px;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  transition: background 0.2s;
  text-decoration: none;
}

.menu-list li a:hover,
#main-menu .menu-list li a.active {
  background-color: rgba(0, 0, 0, 0.3) !important;
  color: #fff !important;
  text-decoration: none;
}

.mobile-only-switch {
  display: none;
  padding: 15px 10px;
  justify-content: center;
}

/* Search */
#search-trigger {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  transition: all 0.2s;
  white-space: nowrap;
}

#search-trigger:hover {
  opacity: 0.8;
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 15px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
}

@media (max-width: 768px) {
  #top-bar {
    display: none;
    /* Hide top bar on mobile as per reference */
  }

  #logo-section {
    padding: 20px 0 10px;
    background-color: #f1503d;
  }

  #logo-section .main-header-grid {
    flex-direction: column !important;
    text-align: center;
    gap: 15px;
  }

  .header-center {
    order: 1;
    width: 100%;
  }

  .main-logo {
    max-width: 90% !important;
    height: auto !important;
  }

  .header-left {
    display: none !important;
  }

  .header-date {
    font-size: 16px !important;
    margin-bottom: 5px;
    color: #555 !important;
  }

  .header-weather {
    font-size: 18px !important;
    font-weight: bold;
    color: #004080 !important;
  }

  .header-right {
    display: none !important;
    /* Hide socials on mobile as per reference */
  }

  #main-menu {
    background-color: #e9e9e9 !important;
    /* Light gray */
    border-bottom: 5px solid #cc0000;
    /* Thick red line */
  }

  .nav-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    padding: 0 15px !important;
    height: 50px;
  }

  .mobile-toggle {
    display: block;
    color: #333 !important;
    padding: 0 !important;
    font-size: 18px !important;
  }

  #search-trigger {
    color: #000080 !important;
    padding: 0 !important;
    font-size: 18px !important;
  }

  .menu-list {
    position: absolute;
    top: 50.5px;
    /* Adjust for red border line if needed */
    left: 0;
    width: 100%;
    background-color: #fff;
    /* Solid white background for light mode */
    z-index: 9999;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    padding: 10px 0 !important;
  }

  [data-theme="dark"] .menu-list {
    background-color: #1a1a1a;
  }

  .menu-list.active {
    display: flex;
    animation: headerSlideDown 0.3s ease-out;
  }

  .menu-list li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  }

  [data-theme="dark"] .menu-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .menu-list li a {
    color: #333 !important;
    padding: 15px 25px !important;
    font-size: 15px !important;
    border-left: 0 solid var(--ypane-orange);
    transition: all 0.3s ease;
  }

  [data-theme="dark"] .menu-list li a {
    color: #eee !important;
  }

  .menu-list li a:hover,
  .menu-list li a.active {
    background-color: var(--bg-secondary) !important;
    color: var(--ypane-orange) !important;
    border-left: 5px solid var(--ypane-orange);
    padding-left: 30px !important;
  }

  .mobile-only-switch {
    display: flex !important;
    padding: 20px;
  }
}

/* --- Search Container --- */
#search-container {
  background-color: var(--bg-secondary);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  display: none;
  animation: headerSlideDown 0.3s ease-out;
}

#search-container.active {
  display: block;
}

@keyframes headerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.search-form {
  display: flex;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  padding: 5px;
  border-radius: 4px;
}

.search-form input {
  flex-grow: 1;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  outline: none;
  background: transparent;
  color: var(--text-main);
}

.search-form button {
  background: none;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
}

.search-form button:hover {
  color: var(--ypane-orange);
}
/* --- Search Category Select --- */
.search-cat-select {
  border: none;
  border-left: 1px solid var(--border-input);
  padding: 0 15px;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  outline: none;
  cursor: pointer;
  max-width: 180px;
}

[data-theme="dark"] .search-cat-select {
  border-left-color: #444;
  color: #bbb;
}

[data-theme="dark"] .search-cat-select option {
  background: #2d2d2d;
  color: #fff;
}

@media (max-width: 600px) {
  .search-form {
    flex-wrap: wrap;
  }
  .search-form input {
    width: 100%;
    border-bottom: 1px solid var(--border-input);
  }
  .search-cat-select {
    width: 100%;
    max-width: 100%;
    border-left: none;
    padding: 10px 15px;
  }
}
