/* ============================================
   Frontier-News.com - Main Stylesheet
   ============================================ */

:root {
  --primary: #0d1b3e;
  --primary-light: #1a3a6b;
  --accent: #c8962e;
  --accent-light: #dbb05c;
  --dark: #070d1a;
  --gray: #8a8fa8;
  --light-bg: #f0f2f8;
  --card-bg: rgba(255,255,255,0.92);
  --gold-gradient: linear-gradient(135deg, #c8962e, #dbb05c, #c8962e);
}

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

html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
  color: #2c2c3e;
  padding-top: 70px;
  background: var(--light-bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(13,27,62,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200,150,46,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(26,58,107,0.02) 0%, transparent 50%);
}

/* ============ Navbar ============ */
#mainNav {
  background: rgba(13,27,62,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(200,150,46,0.1);
  transition: all 0.3s ease;
}
#mainNav.navbar-scrolled { background: rgba(13,27,62,0.99); }
.navbar .nav-link {
  color: rgba(255,255,255,0.8) !important;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1px;
  padding: 0.5rem 1rem !important;
  transition: all 0.3s;
  text-transform: uppercase;
}
.navbar .nav-link:hover { color: var(--accent-light) !important; }
.navbar .nav-link.highlight {
  background: var(--gold-gradient);
  border-radius: 20px;
  padding: 0.4rem 1.2rem !important;
  color: #0d1b3e !important;
  font-weight: 700;
}
.lang-switch { border-left: 1px solid rgba(255,255,255,0.15); padding-left: 0.5rem; }
.lang-link { padding:0.2rem 0.5rem !important; font-weight:600; font-size:0.85rem !important; letter-spacing:1px; border:1px solid transparent; border-radius:4px; }
.lang-link.active { color:var(--accent-light) !important; border-color:var(--accent-light); background:rgba(200,150,46,0.1); }

/* ============ Hero / Banner ============ */
.hero {
  min-height: 85vh;
  background: linear-gradient(160deg, #0a1628 0%, #0d1b3e 30%, #132a54 60%, #1a3a6b 100%);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 40%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 85%, rgba(255,255,255,0.08) 0%, transparent 100%);
}
.hero::after {
  content: '';
  position: absolute;
  top: -30%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(200,150,46,0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroOrb 20s ease-in-out infinite;
}
@keyframes heroOrb { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,30px) scale(1.1); } }
.hero-content { position: relative; z-index: 2; }
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}
.hero h1 small { letter-spacing: 2px; }
.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.9;
  font-weight: 300;
}
.hero .btn-accent {
  background: var(--gold-gradient);
  color: #0d1b3e;
  padding: 0.8rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  border: none;
  transition: all 0.4s;
  letter-spacing: 1px;
  font-size: 0.85rem;
}
.hero .btn-accent:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(200,150,46,0.4); }
.hero .btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.8);
  padding: 0.8rem 2.5rem;
  border-radius: 50px;
  font-weight: 500;
  border: 1px solid rgba(200,150,46,0.4);
  transition: all 0.4s;
  font-size: 0.85rem;
  letter-spacing: 1px;
}
.hero .btn-outline:hover { border-color: var(--accent-light); background: rgba(200,150,46,0.08); color: #fff; }

/* Hero stats */
.hero-stats { margin-top: 3rem; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 2rem; }
.hero-stat { text-align: center; padding: 0.5rem; }
.hero-stat h2 { background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 2rem; font-weight: 800; margin-bottom: 0.2rem; }
.hero-stat p { color: rgba(255,255,255,0.45); font-size: 0.8rem; margin: 0; letter-spacing: 2px; -webkit-text-fill-color: rgba(255,255,255,0.45); text-transform: uppercase; }

/* ============ Section Common ============ */
.section { padding: 5.5rem 0; position: relative; }
.section-alt { background: #fff; }
.section-title { text-align: center; margin-bottom: 3.5rem; }
.section-title h2 {
  font-size: 2rem; font-weight: 700; color: var(--primary);
  position: relative; display: inline-block; margin-bottom: 1.2rem;
  letter-spacing: 3px;
}
.section-title h2::after {
  content: ''; display: block; width: 50px; height: 2px;
  background: var(--gold-gradient); margin: 1rem auto 0; border-radius: 2px;
}
.section-title p { color: var(--gray); max-width: 650px; margin: 0 auto; line-height: 1.9; font-weight: 300; font-size: 0.95rem; }

/* ============ About Section ============ */
.about-img { border-radius: 16px; box-shadow: 0 20px 60px rgba(13,27,62,0.12); width: 100%; }
.about-text h4 { color: var(--primary); font-weight: 700; letter-spacing: 1px; }
.about-text p { color: #555; line-height: 2; font-size: 1rem; font-weight: 300; }

/* ============ Services / Products ============ */
.service-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.2rem 1.8rem;
  text-align: center;
  box-shadow: 0 8px 40px rgba(13,27,62,0.06);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  height: 100%;
  border: 1px solid rgba(255,255,255,0.8);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.5s;
}
.service-card:hover { transform: translateY(-10px); box-shadow: 0 25px 70px rgba(13,27,62,0.12); border-color: rgba(200,150,46,0.2); }
.service-card:hover::before { opacity: 1; }
.service-card .icon {
  width: 72px; height: 72px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 25px rgba(13,27,62,0.15);
  transition: all 0.5s;
}
.service-card:hover .icon { transform: scale(1.08); box-shadow: 0 12px 35px rgba(13,27,62,0.25); }
.service-card .icon i { font-size: 1.8rem; color: #fff; }
.service-card h5 { font-weight: 700; color: var(--primary); margin-bottom: 0.8rem; letter-spacing: 1px; }
.service-card p { color: var(--gray); font-size: 0.88rem; line-height: 1.7; margin: 0; font-weight: 300; }

/* ============ Languages ============ */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.lang-item {
  background: var(--card-bg); border-radius: 14px; padding: 1.2rem 0.8rem;
  text-align: center; box-shadow: 0 4px 20px rgba(13,27,62,0.04);
  border: 1px solid rgba(255,255,255,0.8); transition: all 0.4s;
  font-weight: 600; color: var(--primary); font-size: 0.9rem;
  backdrop-filter: blur(10px);
}
.lang-item:hover { background: var(--primary); color: #fff; transform: scale(1.05); box-shadow: 0 8px 30px rgba(13,27,62,0.2); }

/* ============ Partners ============ */
.partner-item { padding: 0.8rem; text-align: center; }
.partner-item img { max-width: 180px; max-height: 80px; filter: grayscale(0.3); opacity: 0.7; transition: all 0.3s; }
.partner-item:hover img { filter: grayscale(0); opacity: 1; }

/* ============ Contact ============ */
.contact-info {
  padding: 2.5rem; background: var(--card-bg); backdrop-filter: blur(10px);
  border-radius: 20px; box-shadow: 0 8px 40px rgba(13,27,62,0.06);
  height: 100%; border: 1px solid rgba(255,255,255,0.8);
}
.contact-info .info-item { display: flex; align-items: flex-start; margin-bottom: 1.5rem; }
.contact-info .info-item i { font-size: 1.2rem; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; width: 28px; margin-top: 3px; }
.contact-info .info-item strong { color: var(--primary); font-size: 0.85rem; display: block; margin-bottom: 2px; }
.contact-info .info-item span { color: #666; font-size: 0.9rem; }
.contact-form {
  padding: 2.5rem; background: var(--card-bg); backdrop-filter: blur(10px);
  border-radius: 20px; box-shadow: 0 8px 40px rgba(13,27,62,0.06);
  height: 100%; border: 1px solid rgba(255,255,255,0.8);
}
.contact-form .form-control {
  border-radius: 12px; padding: 0.7rem 1rem;
  border: 1px solid rgba(13,27,62,0.1);
  background: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}
.contact-form .form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(26,58,107,0.08); }
.contact-form .btn-primary { background: var(--gold-gradient); border: none; color: #0d1b3e; font-weight: 700; border-radius: 50px; padding: 0.7rem 2rem; letter-spacing: 1px; transition: all 0.4s; }
.contact-form .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(200,150,46,0.3); }
.qr-code { text-align: center; margin-top: 2rem; }
.qr-code img { width: 150px; height: 150px; border-radius: 12px; }
.qr-code p { margin-top: 0.5rem; color: var(--gray); font-size: 0.85rem; }

/* ============ Footer ============ */
.footer {
  background: linear-gradient(180deg, #0a1628 0%, #070d1a 100%);
  color: rgba(255,255,255,0.5); padding: 2.5rem 0;
  font-size: 0.85rem; line-height: 1.8;
  border-top: 1px solid rgba(200,150,46,0.08);
}
.footer a.footer-link { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.3s; }
.footer a.footer-link:hover { color: var(--accent-light); }
.share-buttons { margin-top: 0.5rem; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.5);
  text-decoration: none; transition: all 0.3s; margin-left: 0.3rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.share-btn:hover { background: var(--accent); color: #0d1b3e; border-color: var(--accent); }

/* ============ Chatbot ============ */
.chatbot-toggle {
  position: fixed; bottom: 25px; right: 25px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold-gradient); color: #0d1b3e;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 25px rgba(200,150,46,0.35);
  z-index: 9999; transition: all 0.3s;
  animation: chatbotPulse 3s ease-in-out infinite;
}
.chatbot-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 35px rgba(200,150,46,0.5); }
@keyframes chatbotPulse { 0%,100% { box-shadow: 0 4px 25px rgba(200,150,46,0.35); } 50% { box-shadow: 0 4px 40px rgba(200,150,46,0.6); } }
.chatbot-window { position: fixed; bottom: 95px; right: 25px; width: 360px; height: 480px; background: #fff; border-radius: 20px; box-shadow: 0 15px 80px rgba(13,27,62,0.2); z-index: 9998; display: none; flex-direction: column; overflow: hidden; }
.chatbot-window.open { display: flex; }
.chatbot-header { background: var(--primary); color: #fff; padding: 1rem 1.2rem; display: flex; justify-content: space-between; align-items: center; font-weight: 600; letter-spacing: 1px; border-bottom: 1px solid rgba(200,150,46,0.2); }
.chatbot-body { flex: 1; padding: 1rem; overflow-y: auto; background: #f8f9fc; }
.chat-message { display: flex; margin-bottom: 1rem; align-items: flex-start; }
.chat-message.bot { justify-content: flex-start; }
.chat-message.user { justify-content: flex-end; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.chat-message.bot .chat-avatar { background: rgba(13,27,62,0.08); color: var(--primary); margin-right: 0.5rem; }
.chat-message.user .chat-avatar { background: var(--gold-gradient); color: #0d1b3e; margin-left: 0.5rem; order: 1; }
.chat-text { max-width: 78%; padding: 0.8rem 1.1rem; border-radius: 16px; font-size: 0.88rem; line-height: 1.5; }
.chat-message.bot .chat-text { background: #fff; border-bottom-left-radius: 4px; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.chat-message.user .chat-text { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
/* Admin mode: admin's own replies (right, black text) */
.chat-message.admin { justify-content: flex-end; }
.chat-message.admin .chat-avatar { background: var(--gold-gradient); color: #0d1b3e; margin-left: 0.5rem; order: 1; }
.chat-message.admin .chat-text { background: #e8eaf6; color: #1a1a1a; border-bottom-right-radius: 4px; }
/* Admin mode: visitor messages (left, blue text) */
.chat-message.visitor { justify-content: flex-start; }
.chat-message.visitor .chat-avatar { background: rgba(13,27,62,0.08); color: var(--primary); margin-right: 0.5rem; }
.chat-message.visitor .chat-text { background: #e3f2fd; color: #0d47a1; border-bottom-left-radius: 4px; }
.chatbot-footer { display: flex; padding: 0.7rem; gap: 0.5rem; border-top: 1px solid rgba(0,0,0,0.04); background: #fff; }
.chatbot-footer input { border-radius: 50px; border: 1px solid rgba(0,0,0,0.08); background: #f5f6fa; font-size: 0.88rem; }
.chatbot-footer .btn-outline-secondary { border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding:0; }
.chatbot-footer button { border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--gold-gradient); border: none; color: #0d1b3e; }

/* ============ AI PDF Section ============ */
.pdf-hero { background: linear-gradient(160deg, #0a1628 0%, #0d1b3e 50%, #1a3a6b 100%); padding: 2rem 0; text-align: center; color: #fff; }
.pdf-hero h1 { font-size: 1.8rem; font-weight: 800; }
.pdf-hero p { color: rgba(255,255,255,0.55); }
.pdf-tool-card { background: #fff; border-radius: 16px; padding: 1rem; box-shadow: 0 4px 20px rgba(13,27,62,0.04); border: 2px solid transparent; transition: all 0.3s; cursor: pointer; text-align: center; height: 100%; }
.pdf-tool-card:hover, .pdf-tool-card.active { border-color: var(--accent); box-shadow: 0 8px 35px rgba(200,150,46,0.12); }
.pdf-tool-card .pdf-icon { width: 45px; height: 45px; margin: 0 auto 0.8rem; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; }
.pdf-tool-card h5 { font-weight: 700; color: var(--primary); margin-bottom: 0.3rem; font-size: 0.9rem; }
.pdf-tool-card p { color: var(--gray); font-size: 0.8rem; margin: 0; }
.pdf-upload-area { border: 2px dashed rgba(13,27,62,0.15); border-radius: 16px; padding: 2rem; text-align: center; background: rgba(255,255,255,0.6); transition: all 0.3s; cursor: pointer; }
.pdf-upload-area:hover { border-color: var(--primary-light); background: rgba(255,255,255,0.9); }
.pdf-upload-area i { font-size: 2.5rem; color: var(--primary-light); }
.pdf-upload-area p { color: var(--gray); margin-top: 0.5rem; font-size: 0.85rem; }
.pdf-upload-area .small { font-size: 0.75rem; }

.pdf-status { margin-top: 1.5rem; }
.pdf-pay-modal .modal-header { background: var(--primary); color: #fff; }
.pdf-pay-modal .pay-qr { text-align: center; padding: 2rem; }
.pdf-pay-modal .pay-qr img { width: 200px; height: 200px; }
.pdf-pay-modal .pay-price { font-size: 1.5rem; font-weight: 800; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-align: center; }

/* ============ Page / Detail ============ */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, #283593 100%);
  padding: 3rem 0;
  color: #fff;
}
.page-header h1 { font-weight: 700; }
.page-content { padding: 3rem 0; }
.page-content img { max-width: 100%; border-radius: 12px; }
.breadcrumb-custom {
  background: transparent;
  padding: 0;
  margin-bottom: 1.5rem;
}
.breadcrumb-custom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.breadcrumb-custom a:hover { color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-stat h2 { font-size: 1.5rem; }
  .section-title h2 { font-size: 1.5rem; }
  .chatbot-window { width: calc(100vw - 30px); height: 400px; right: 15px; bottom: 85px; }
  .pdf-tool-card { margin-bottom: 1rem; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
}
