/* /css/header.css - Unified Header Styles */
/* Include this CSS in pages that use the shared header component */

/* ===== CSS Variables (shared) ===== */
:root {
  --oda-primary: #ff5722;
  --oda-primary-dark: #e64a19;
  --oda-bg: #f5f5f5;
  --oda-white: #ffffff;
  --oda-text: #333333;
  --oda-text-muted: #757575;
  --oda-border: #e0e0e0;
  --oda-success: #4caf50;
  --oda-error: #f44336;
  --oda-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --oda-radius: 12px;
}

/* ===== HEADER ===== */
.oda-header {
  background: var(--oda-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--oda-border);
}

.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.header-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.header-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--oda-text);
}

@media (max-width: 480px) {
  .header-logo-text {
    display: none;
  }
}

/* Search */
.header-search {
  flex: 1;
  max-width: 500px;
  margin: 0 10px;
}

.header-search form {
  display: flex;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px;
  padding-right: 44px;
  border: 1px solid var(--oda-border);
  border-radius: 25px;
  font-size: 14px;
  background: var(--oda-bg);
  transition: all 0.2s ease;
  outline: none;
}

.header-search input:focus {
  border-color: var(--oda-primary);
  background: var(--oda-white);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.header-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--oda-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.header-search button:hover {
  background: var(--oda-primary-dark);
}

/* Menu Toggle */
.header-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.header-menu-toggle:hover {
  background: var(--oda-bg);
}

.header-menu-toggle i {
  font-size: 18px;
  color: var(--oda-primary);
}

.header-menu-toggle span {
  font-size: 9px;
  color: var(--oda-text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* Back Button */
.header-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--oda-bg);
  border: none;
  border-radius: 20px;
  color: var(--oda-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.header-back-btn:hover {
  background: var(--oda-border);
}

.header-back-btn i {
  font-size: 14px;
}

/* Divider */
.header-divider {
  height: 1px;
  background: var(--oda-border);
}

/* Navigation */
.header-nav {
  display: flex;
  justify-content: space-around;
  padding: 8px 10px;
  background: var(--oda-white);
}

.header-nav-btn {
  background: none;
  border: none;
  color: var(--oda-text-muted);
  font-size: 18px;
  padding: 8px 16px;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.header-nav-btn:hover {
  background: var(--oda-bg);
  color: var(--oda-text);
}

.header-nav-btn.active {
  color: var(--oda-primary);
}

.header-nav-counter {
  position: absolute;
  top: 2px;
  right: 6px;
  background: var(--oda-error);
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.header-nav-counter:not(:empty) {
  display: flex;
}

/* ===== MEGA MENU ===== */
.oda-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.oda-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.oda-mega-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: var(--oda-white);
  z-index: 2001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.oda-mega-menu.open {
  right: 0;
}

.mega-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, var(--oda-primary), var(--oda-primary-dark));
  color: white;
  flex-shrink: 0;
}

.mega-menu-header h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.mega-menu-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu User Section */
.mega-menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--oda-bg);
  border-bottom: 1px solid var(--oda-border);
}

.mega-menu-user img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--oda-primary);
}

.mega-user-info {
  flex: 1;
  min-width: 0;
}

.mega-user-name {
  font-weight: 600;
  color: var(--oda-text);
  margin: 0 0 2px 0;
  font-size: 15px;
}

.mega-user-status {
  font-size: 12px;
  color: var(--oda-text-muted);
  margin: 0;
}

/* Menu Stats */
.mega-menu-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  background: var(--oda-bg);
  border-bottom: 1px solid var(--oda-border);
}

.mega-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.mega-stat:hover {
  background: var(--oda-white);
}

.mega-stat i {
  font-size: 18px;
  color: var(--oda-primary);
  margin-bottom: 4px;
}

.mega-stat span {
  font-weight: 700;
  font-size: 16px;
  color: var(--oda-text);
}

.mega-stat small {
  font-size: 10px;
  color: var(--oda-text-muted);
}

/* Menu Sections */
.mega-menu-section {
  padding: 16px;
  border-bottom: 1px solid var(--oda-border);
}

.mega-menu-section h4 {
  font-size: 12px;
  color: var(--oda-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mega-menu-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--oda-bg);
  color: var(--oda-text);
  font-size: 11px;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}

.mega-menu-grid a:hover {
  background: var(--oda-primary);
  color: white;
}

.mega-menu-grid a i {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--oda-primary);
}

.mega-menu-grid a:hover i {
  color: white;
}

/* Menu Links */
.mega-menu-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--oda-text);
  text-decoration: none;
  transition: background 0.2s;
}

.mega-menu-links a:hover {
  background: var(--oda-bg);
}

.mega-menu-links a i {
  width: 20px;
  color: var(--oda-primary);
}

/* Menu Footer */
.mega-menu-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--oda-border);
}

.mega-login-btn,
.mega-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.mega-login-btn {
  background: var(--oda-primary);
  color: white;
}

.mega-login-btn:hover {
  background: var(--oda-primary-dark);
}

.mega-logout-btn {
  background: var(--oda-bg);
  color: var(--oda-text);
  border: 1px solid var(--oda-border);
}

.mega-logout-btn:hover {
  background: var(--oda-error);
  color: white;
  border-color: var(--oda-error);
}

/* ===== BACK BUTTON (for inner pages) ===== */
.header-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--oda-border);
  background: var(--oda-white);
  color: var(--oda-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-back-btn:hover {
  background: var(--oda-bg);
  border-color: var(--oda-primary);
  color: var(--oda-primary);
}

/* ===== OFFLINE INDICATOR ===== */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff9800;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  z-index: 9999;
  display: none;
}

.offline-indicator.show {
  display: block;
}

.offline-indicator i {
  margin-right: 6px;
}
