/* ================================================================
   PEN MAPS - FRONTEND STYLESHEET (TRODN LIGHT THEME: NỀN SÁNG CAM NÂU)
   ================================================================ */

:root {
  --bg-main: #fdfbf7;
  --bg-card: #ffffff;
  --bg-card-hover: #faf6f1;
  --bg-sidebar: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #f5efe6;
  --border-color: #e8ded1;
  --border-focus: #d85d15;
  
  --primary: #d85d15;
  --primary-hover: #b44a0e;
  --primary-glow: rgba(216, 93, 21, 0.15);
  --primary-subtle: rgba(216, 93, 21, 0.08);
  
  --text-main: #4a3e3d;
  --text-heading: #2c1d11;
  --text-muted: #7a6e65;
  --text-dim: #94897d;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(44, 29, 17, 0.05);
  --shadow-md: 0 4px 12px rgba(44, 29, 17, 0.07);
  --shadow-lg: 0 12px 30px rgba(44, 29, 17, 0.12);
  --font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 14.5px;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 14px;
  }
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(216, 93, 21, 0.25);
  color: #fff;
}

.btn-secondary {
  background-color: #fff;
  color: var(--text-heading);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ==================== HEADER ==================== */
.main-header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-shadow: 0 2px 8px rgba(44, 29, 17, 0.03);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-heading);
}

.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-heading);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-main);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-create-map {
  background: linear-gradient(135deg, var(--primary) 0%, #ff7e36 100%);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(216, 93, 21, 0.2);
  border: none;
}

.btn-create-map:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(216, 93, 21, 0.35);
}

.btn-header-login {
  background-color: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 6.5px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-login:hover {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* User dropdown on header */
.header-user-menu {
  position: relative;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-user-btn:hover {
  border-color: var(--primary);
  background-color: #faf6f1;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
}

.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-user-menu:hover .header-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.header-dropdown-item:hover {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

.header-dropdown-item.danger {
  color: var(--danger);
}

.header-dropdown-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-heading);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 992px) {
  .mobile-nav-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    flex-direction: column;
    align-items: flex-start;
    padding: 60px 20px 20px;
    gap: 16px;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }
  .nav-links.active {
    left: 0;
  }
}

/* ==================== HERO SECTION (TRODN AMBIENT) ==================== */
.hero-section {
  background: linear-gradient(135deg, #2a1b0e 0%, #442a15 100%);
  position: relative;
  overflow: hidden;
  padding: 75px 0 65px;
  text-align: center;
}

.hero-glow-1, .hero-glow-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.6;
}

.hero-glow-1 {
  width: 320px;
  height: 320px;
  background: rgba(234, 88, 12, 0.2);
  top: -80px;
  left: 10%;
}

.hero-glow-2 {
  width: 350px;
  height: 350px;
  background: rgba(251, 191, 36, 0.12);
  bottom: -80px;
  right: 15%;
}

.hero-container {
  max-width: 840px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 30px;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

.search-box-wrapper {
  background-color: #fff;
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  max-width: 680px;
  margin: 0 auto;
}

.search-box-form {
  display: flex;
  gap: 6px;
}

.search-box-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 18px;
  color: #2c1d11;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.search-box-input::placeholder {
  color: #94897d;
}

.hero-quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.quick-tag {
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.quick-tag:hover {
  background: #fff;
  border-color: #fff;
  color: var(--primary);
  transform: translateY(-1px);
}

/* ==================== SECTION LAYOUTS ==================== */
.portal-section {
  padding: 50px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-heading);
  border-left: 4px solid var(--primary);
  padding-left: 12px;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== MAPS GRID ==================== */
.map-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .map-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .map-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .map-grid {
    grid-template-columns: 1fr;
  }
}

.portal-map-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.portal-map-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.map-card-thumb {
  height: 180px;
  background-color: #f5efe6;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.map-card-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.map-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  line-height: 1.4;
}

.map-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.map-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ==================== POSTS / NEWS GRID ==================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.portal-news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.portal-news-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.news-card-thumb {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #f5efe6;
}

.news-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-category {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.news-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-card-title a:hover {
  color: var(--primary);
}

.news-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* ==================== AUTH POPUP MODAL ==================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(44, 29, 17, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-modal-box {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 92%;
  box-shadow: 0 20px 40px rgba(44, 29, 17, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.auth-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-tabs {
  display: flex;
  background-color: #faf6f1;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: #fff;
}

.auth-modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background-color: #faf8f5;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--border-focus);
  background-color: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==================== FOOTER ==================== */
.main-footer {
  background-color: #2a1b0e;
  color: #fff;
  border-top: 1px solid #3d281a;
  padding: 60px 0 25px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.footer-links-list li {
  margin-bottom: 8px;
}

.footer-links-list a {
  color: #a79c95;
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer-links-list a:hover {
  color: #ff7e36;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #8c7e76;
  font-size: 12.5px;
}
