/**
 * MI Tags Manager - Navigation Styles
 * Navigation bar and related components
 */

/* ============================================================================
   Navigation Bar
   ============================================================================ */

nav {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  padding: 1rem 0;
  height: 90px;

  .logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }

  a {
    color: var(--text-tertiary);
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;

    &:hover {
      color: var(--primary-color);
      background: var(--bg-tertiary);
    }
  }

  .nav-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
  }

  .nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
  }

  .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;

    .nav-link {
      color: #aaa;
      font-weight: 500;
      text-decoration: none;
      transition: color 0.3s ease;
      cursor: pointer;
      position: relative;

      &:hover {
        color: #667eea;
      }

      &.active {
        color: #667eea;
        font-weight: 600;

        &::after {
          content: '';
          position: absolute;
          bottom: -1px;
          left: 0;
          right: 0;
          height: 2px;
          background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
          border-radius: 2px;
        }
      }
    }
  }

  .nav-actions {
    display: flex;
    padding: 1rem;
    gap: 1rem;
    align-items: center;

    .nav-user-email {
      color: #aaa;
      font-size: 1rem;
    }

    #logout-btn {
      font-size: 0.9rem;
      padding: 0.4rem 0.75rem;
    }
  }

  .nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.4rem;
    padding: 0.5rem;

    span {
      width: 25px;
      height: 3px;
      background: #667eea;
      border-radius: 2px;
      transition: all 0.3s ease;
    }

    &.active {
      span:nth-child(1) {
        transform: rotate(45deg) translateY(10px);
      }

      span:nth-child(2) {
        opacity: 0;
      }

      span:nth-child(3) {
        transform: rotate(-45deg) translateY(-10px);
      }
    }
  }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  nav {
    padding: 0.75rem 0;

    .nav-content {
      flex-wrap: wrap;
      padding: 0 1rem;
    }

    .logo {
      font-size: 1.3rem;
      min-width: 120px;
    }

    .nav-toggle {
      display: flex;
    }

    .nav-actions {
      display: flex;
      gap: 0.75rem;

      #logout-btn {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
      }
    }
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.5rem 0;
    height: 60px;

    &:has(.nav-actions:not([style*="display: none"])) {
      height: 120px;
    }

    .nav-content {
      flex-wrap: wrap;
      padding: 0;
    }

    .logo {
      font-size: 1rem;
      flex: 1;
      min-width: 100px;
    }

    .nav-links {
      display: none !important;
      flex-direction: column;
      width: 100%;
      gap: 0;
      padding: 0.5rem 0;
      border-top: 1px solid rgba(102, 126, 234, 0.1);
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
      margin-top: 0.5rem;

      &.active {
        display: flex !important;
      }

      .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 1rem;
        text-align: center;
        width: 100%;

        &.active {
          background: rgba(102, 126, 234, 0.1);
          border-radius: 4px;
        }

        &.active::after {
          display: none;
        }
      }
    }

    .nav-actions {
      display: none;
      width: 100%;
      justify-content: flex-end;
      align-items: center;
      gap: 0.5rem;      
      border-top: 1px solid rgba(102, 126, 234, 0.1);
      margin-top: 0.5rem;

      .nav-user-email {
        text-align: end;
        flex: 1;
      }

      .btn-login,
      #logout-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: auto;
      }

      &:has(#logout-btn:not([style*="display: none"])) {
        display: flex;
      }
    }
  }
}
