/**
 * common.css
 * RWL-UX-REFINE-01 - Unified Navigation & Footer
 *
 * Purpose: Consistent nav/footer across all pages
 * - Portal, Encyclopedia, Daily, Campaign
 * - Mobile-first responsive design
 */

/* ========== Body Reset (ensure consistent nav position) ========== */
html {
  margin: 0;
  padding: 0;
  overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
}

body {
  margin: 0;
  padding: 0;
}

/* ========== Global Nav ========== */
.global-nav {
  background: #fff;
  border-bottom: 2px solid #c30d23;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.global-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.global-nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: #c30d23;
  text-decoration: none;
  white-space: nowrap;
}

.global-nav-logo:hover {
  opacity: 0.8;
}

.global-nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.global-nav-links a {
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.global-nav-links a:hover,
.global-nav-links a.active {
  background: #f5f5f5;
  color: #c30d23;
}

.global-nav-links a.active {
  font-weight: 600;
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
}

@media (max-width: 640px) {
  .global-nav-inner {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .nav-toggle {
    display: block;
  }

  .global-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 8px;
  }

  .global-nav-links.open {
    display: flex;
  }

  .global-nav-links a {
    padding: 12px;
    border-radius: 0;
  }
}

/* ========== Global Footer ========== */
.global-footer {
  background: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  padding: 24px 16px;
  margin-top: 48px;
  font-size: 12px;
  color: #666;
}

.global-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-nav a {
  color: #333;
  text-decoration: none;
  font-size: 13px;
}

.footer-nav a:hover {
  color: #c30d23;
  text-decoration: underline;
}

.footer-disclaimer {
  color: #999;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.footer-generated {
  color: #999;
  font-size: 11px;
}

.footer-copyright {
  color: #666;
}

/* ========== Image Placeholders ========== */
.image-placeholder,
.product-image-placeholder,
.brand-logo-placeholder {
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-image-placeholder::before {
  content: "No Image";
}

.brand-logo-placeholder::before {
  content: "Logo";
}

/* ========== Status Badges ========== */
.badge-new {
  display: inline-block;
  padding: 2px 6px;
  background: #4caf50;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-watched {
  display: inline-block;
  padding: 2px 6px;
  background: #1a73e8;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
}

.badge-updated {
  display: inline-block;
  padding: 2px 6px;
  background: #ff9800;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
}

/* ========== Quick Links Block ========== */
.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 6px;
  margin-bottom: 16px;
}

.quick-nav a {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  font-size: 12px;
  color: #333;
  text-decoration: none;
  transition: all 0.15s;
}

.quick-nav a:hover {
  background: #c30d23;
  color: #fff;
  border-color: #c30d23;
}

/* ========== Page Transitions ========== */
.page-content {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== No Data States ========== */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #999;
}

.empty-state-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.empty-state-hint {
  font-size: 12px;
  color: #999;
}

/* ========== Data Period Indicator ========== */
.data-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #999;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: 4px;
}

.data-period-live {
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========== Utility Classes ========== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: #999;
}

.text-small {
  font-size: 12px;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
