@use "../../global/assets/styles/abstracts" as *;

.#{$demo-prefix}-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 20px rgba(59, 130, 246, 0.05);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(20px);
  transition: all var(--transition-base);

  // Modern glassmorphism effect
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.4) 0%,
      rgba(255, 255, 255, 0.1) 100%
    );
    pointer-events: none;
  }

  &-content {
    @include flex-between;
    max-width: 100%;
    height: 100%;
    padding: 0 var(--space-6);
    position: relative;
    z-index: 1;

    @include media-down(md) {
      padding: 0 var(--space-4);
    }
  }

  &-left {
    @include flex-start;
  }

  &-logo {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1);

    &:hover {
      background-color: rgba(59, 130, 246, 0.05);
    }
  }

  &-right {
    @include flex-start;
  }

  &-nav {
    @include flex-start;
    gap: var(--space-2);

    &-item {
      @include flex-start;
      gap: var(--space-2);
      padding: var(--space-2-5) var(--space-4);
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--gray-600);
      text-decoration: none;
      border-radius: var(--radius-xl);
      transition: all var(--transition-base);
      border: 1px solid transparent;
      background: rgba(255, 255, 255, 0.6);
      backdrop-filter: blur(8px);
      position: relative;
      overflow: hidden;

      // Modern hover effect
      &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
          135deg,
          rgba(59, 130, 246, 0.1) 0%,
          rgba(147, 197, 253, 0.05) 100%
        );
        opacity: 0;
        transition: opacity var(--transition-base);
      }

      &:hover {
        color: var(--primary-700);
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(59, 130, 246, 0.2);
        transform: translateY(-1px);
        box-shadow:
          0 4px 12px rgba(59, 130, 246, 0.15),
          0 0 0 1px rgba(59, 130, 246, 0.1);

        &::before {
          opacity: 1;
        }
      }

      &:active {
        transform: translateY(0);
      }

      span {
        position: relative;
        z-index: 1;

        @include media-down(md) {
          display: none;
        }
      }

      svg {
        transition: all var(--transition-base);
        position: relative;
        z-index: 1;
      }

      &:hover svg {
        color: var(--primary-600);
        transform: scale(1.05);
      }
    }
  }
}

// Clean logo component
.#{$demo-prefix}-logo {
  @include flex-start;
  gap: var(--space-3);

  &-icon {
    @include flex-center;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: var(--tracking-tight);
    box-shadow: var(--shadow-primary);
    font-family: var(--font-display);
  }

  &-text {
    display: flex;
    flex-direction: column;

    @include media-down(sm) {
      display: none;
    }
  }

  &-title {
    font-size: var(--text-lg);
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--gray-900);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
  }

  &-subtitle {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--gray-500);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
  }
}

// Mobile menu button
.#{$demo-prefix}-mobile-menu-btn {
  @include flex-center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: var(--radius-lg);
  display: none;
  color: var(--gray-600);
  transition: all var(--transition-base);

  @include media-down(md) {
    display: flex;
  }

  &:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
  }

  svg {
    transition: transform var(--transition-base);
  }

  &.active svg {
    transform: rotate(90deg);
  }
}

// Clean search box
.#{$demo-prefix}-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 300px;
  width: 100%;
  margin: 0 var(--space-4);

  @include media-down(lg) {
    display: none;
  }

  &-input {
    @include input-base;
    width: 100%;
    padding-left: var(--space-10);
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--gray-200);

    &:focus {
      background: white;
      box-shadow:
        var(--shadow-md),
        0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    &:hover:not(:focus) {
      border-color: var(--gray-300);
    }
  }

  &-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--gray-400);
    transition: color var(--transition-base);
    pointer-events: none;
  }

  &:focus-within &-icon {
    color: var(--primary-500);
  }
}

// Simple notification badge
.#{$demo-prefix}-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--accent-danger);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

// Responsive adjustments
@include media-down(sm) {
  .#{$demo-prefix}-header {
    &-nav {
      gap: var(--space-0-5);

      &-item {
        padding: var(--space-1-5) var(--space-2);
        font-size: var(--text-xs);
      }
    }
  }

  .#{$demo-prefix}-logo {
    gap: var(--space-2);

    &-icon {
      width: 36px;
      height: 36px;
      font-size: 0.75rem;
    }

    &-title {
      font-size: var(--text-base);
    }
  }
}

// RTL Support for Header
[dir="rtl"] .#{$demo-prefix}-header {
  &-content {
    flex-direction: row-reverse;
  }

  &-left {
    flex-direction: row-reverse;
  }

  &-right {
    flex-direction: row-reverse;
  }

  &-nav {
    flex-direction: row-reverse;
  }

  &-logo {
    .#{$demo-prefix}-logo {
      flex-direction: row-reverse;
    }
  }
}
