/**
 * YIT Enhanced Header Styles
 * Based on the original YIT D7 theme but modernized for D11
 */

/* Reset and Base */
* {
  box-sizing: border-box;
}

.yit-header {
  position: relative;
  z-index: 1000;
}

/* Top Bar with Background Image */
.yit-top-bar {
  background-color: #003366;
  background-image: url('../images/float-header-sea-small.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  min-height: 160px;
  border-bottom: 6px solid #00366D;
  position: relative;
}

.yit-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 160px;
  gap: 20px;
}

/* Logo and Site Name */
.yit-branding {
  flex: 0;
}

.yit-logo {
  display: none;
}

.yit-logo img {
  width: 80px;
  height: auto;
  display: block;
}

.yit-site-title {
  position: absolute;
  left: 90px;
  top: 10px;
}

.yit-site-name {
  background: #19252D;
  display: inline-block;
  line-height: 1em;
  padding: 0.333em 0.5em 0.25em 0.5em;
  color: #FFFFFF;
  font-size: 1.8em;
  border-radius: 0 0 12px 0;
  margin: 0;
  font-weight: bold;
  white-space: nowrap;
}

.yit-site-name a {
  color: #FFFFFF;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.yit-site-name a:hover {
  color: #EFEFEF;
}

/* Main Navigation */
.yit-main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.yit-nav-items {
  display: flex;
  gap: 5px;
  align-items: center;
}

.yit-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  text-decoration: none;
  color: #003366;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 90px;
}

.yit-nav-item:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.yit-nav-item .yit-icon {
  width: 32px;
  height: 32px;
}

/* Right Side Navigation */
.yit-right-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Dropdown Styles */
.yit-dropdown {
  position: relative;
}

.yit-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #003366;
  transition: all 0.3s ease;
}

.yit-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 1);
}

.yit-dropdown-toggle .yit-icon {
  width: 20px;
  height: 20px;
}

.yit-dropdown-toggle .yit-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.yit-dropdown:hover .yit-chevron,
.yit-dropdown.active .yit-chevron {
  transform: rotate(180deg);
}

.yit-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.yit-dropdown:hover .yit-dropdown-menu,
.yit-dropdown.active .yit-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.yit-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

.yit-dropdown-menu a:hover {
  background: #f5f5f5;
}

.yit-dropdown-menu hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

.yit-dropdown-menu .yit-icon-sm {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* User Menu Specific Styles */
.yit-user-dropdown .yit-dropdown-menu {
  min-width: 250px;
}

.yit-user-welcome {
  padding: 12px 16px;
  font-size: 13px;
  color: #666;
  background: #f8f8f8;
  border-radius: 8px 8px 0 0;
}

.yit-user-welcome span {
  font-weight: 700;
  color: #003366;
}

.yit-logout {
  color: #d32f2f !important;
}

.yit-logout:hover {
  background: #ffebee !important;
}

/* Badge for unread messages */
.yit-badge {
  display: inline-block;
  background: #f44336;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
}

/* Buttons */
.yit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.yit-btn .yit-icon {
  width: 20px;
  height: 20px;
}

.yit-btn-membership {
  background: #4CAF50;
  color: white;
}

.yit-btn-membership:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.yit-btn-login {
  background: #4A90E2;
  color: white;
}

.yit-btn-login:hover {
  background: #357abd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.yit-btn-user {
  background: #4A90E2;
  color: white;
}

.yit-btn-user .yit-icon {
  width: 24px;
  height: 24px;
}

.yit-btn-user:hover {
  background: #357abd;
}

/* Secondary Bar */
.yit-secondary-bar {
  background: #003366;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.yit-secondary-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.yit-links {
  display: flex;
  gap: 20px;
}

.yit-links a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.yit-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.yit-facebook-like {
  display: flex;
  align-items: center;
}

/* Status Messages */
.yit-messages-wrapper {
  background: #7CB342;
  color: white;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 500;
}

.yit-messages-wrapper.error {
  background: #E53935;
}

.yit-messages-wrapper.warning {
  background: #FB8C00;
}

.yit-messages-wrapper.status {
  background: #7CB342;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
  .yit-header-inner {
    flex-wrap: wrap;
  }

  .yit-nav-items {
    flex-wrap: wrap;
  }

  .yit-right-nav {
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .yit-site-name {
    font-size: 2em;
  }

  .yit-nav-item {
    min-width: 70px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .yit-nav-item .yit-icon {
    width: 24px;
    height: 24px;
  }

  .yit-dropdown-toggle,
  .yit-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .yit-top-bar {
    background-size: cover;
    background-position: center;
  }
}

@media (max-width: 480px) {
  .yit-branding {
    flex-direction: column;
  }

  .yit-site-title {
    position: static;
  }

  .yit-site-name {
    font-size: 1.5em;
    padding: 0.2em;
  }

  .yit-nav-items {
    gap: 3px;
  }

  .yit-nav-item span {
    display: none;
  }

  .yit-secondary-inner {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 575px) {
  /* Prevent header from causing horizontal overflow */
  .yit-top-bar {
    overflow: hidden;
  }

  /* Compact the header inner to fit small screens */
  .yit-header-inner {
    gap: 6px;
  }

  /* Hide text labels in dropdown/button items — icon only */
  .yit-dropdown-toggle span,
  .yit-btn-membership span,
  .yit-btn-login span {
    display: none;
  }

  /* Hide the chevron arrows to save space */
  .yit-dropdown-toggle .yit-chevron {
    display: none;
  }

  /* Reduce button/dropdown padding to icon-only size */
  .yit-dropdown-toggle,
  .yit-btn {
    padding: 8px;
    gap: 0;
  }

  /* Compact right-nav */
  .yit-right-nav {
    gap: 4px;
  }

  /* Compact nav items */
  .yit-nav-item {
    min-width: 0;
    padding: 6px 8px;
  }
}

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

/* Icon Base Styling */
.yit-icon {
  fill: currentColor;
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

svg.yit-icon {
  max-width: 100%;
  max-height: 100%;
}

.yit-icon-sm {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

svg.yit-icon-sm {
  max-width: 100%;
  max-height: 100%;
}
