/* 
  CIC Official Replica & Copilot Studio Demo Stylesheet
  Colors: CIC Green (#007A3D, #006837, #88C43D), Slate (#1C252C), Warm Off-white (#F7F9FA)
*/

:root {
  --cic-green-primary: #007A3D;
  --cic-green-dark: #00562B;
  --cic-green-light: #88C43D;
  --cic-gold: #ECA100;
  --cic-text-dark: #1C252C;
  --cic-text-muted: #5A6A75;
  --cic-bg-light: #F7F9FA;
  --cic-card-bg: #FFFFFF;
  --cic-border-color: #E2E8F0;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 16px rgba(0,122,61,0.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang HK', 'Microsoft JhengHei', sans-serif;
  color: var(--cic-text-dark);
  background-color: var(--cic-bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--cic-green-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cic-green-dark);
}

/* ==========================================================================
   TOP ANNOUNCEMENT BAR & UTILITY HEADER
   ========================================================================== */
.top-utility-bar {
  background-color: #0d2818;
  color: #d1e7dd;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.utility-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.utility-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tag-announcement {
  background: var(--cic-gold);
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.utility-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lang-switch span, .font-size-adjust span {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}

.lang-switch span.active {
  background-color: var(--cic-green-primary);
  color: white;
  font-weight: 600;
}

/* ==========================================================================
   MAIN NAVIGATION HEADER
   ========================================================================== */
.main-header {
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo img {
  height: 54px;
  width: auto;
  display: block;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-item > a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cic-text-dark);
  padding: 8px 0;
  position: relative;
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--cic-green-primary);
  transition: width var(--transition-fast);
}

.nav-item:hover > a::after,
.nav-item.active > a::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-search {
  background: #F0F4F2;
  border: none;
  padding: 10px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--cic-text-muted);
  transition: background var(--transition-fast);
}

.btn-search:hover {
  background: #E2EBE6;
  color: var(--cic-green-primary);
}

.btn-portal-primary {
  background: var(--cic-green-primary);
  color: white !important;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 10px rgba(0, 122, 61, 0.2);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn-portal-primary:hover {
  background: var(--cic-green-dark);
  transform: translateY(-1px);
}

/* ==========================================================================
   HERO BANNER CAROUSEL
   ========================================================================== */
.hero-section {
  position: relative;
  height: 520px;
  background: #111;
  overflow: hidden;
  color: white;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  background-size: cover;
  background-position: center;
}

.slide.active {
  opacity: 1;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,40,18,0.85) 0%, rgba(0,40,18,0.4) 60%, rgba(0,0,0,0.1) 100%);
}

.slide-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  z-index: 10;
}

.slide-tag {
  background: rgba(136, 196, 61, 0.9);
  color: #003618;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.slide-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.25;
  max-width: 750px;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.slide-description {
  font-size: 1.15rem;
  max-width: 650px;
  margin-bottom: 28px;
  color: #E2EBE6;
}

.hero-controls {
  position: absolute;
  bottom: 24px;
  right: 48px;
  display: flex;
  gap: 10px;
  z-index: 20;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.slider-dot.active {
  background: var(--cic-green-light);
  width: 32px;
  border-radius: 6px;
}

/* ==========================================================================
   QUICK SERVICES & PORTALS SECTION
   ========================================================================== */
.section-services {
  padding: 64px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 2rem;
  color: var(--cic-green-primary);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--cic-text-muted);
  font-size: 1.05rem;
}

.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.portal-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--cic-border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--cic-green-primary);
}

.portal-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(0, 122, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cic-green-primary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.portal-card:hover .portal-icon {
  background: var(--cic-green-primary);
  color: white;
}

.portal-card h4 {
  font-size: 1.1rem;
  color: var(--cic-text-dark);
  margin-bottom: 8px;
}

.portal-card p {
  font-size: 0.88rem;
  color: var(--cic-text-muted);
}

/* ==========================================================================
   STATISTICS & HIGHLIGHTS BANNER
   ========================================================================== */
.stats-banner {
  background: linear-gradient(135deg, var(--cic-green-dark) 0%, var(--cic-green-primary) 100%);
  color: white;
  padding: 48px 24px;
}

.stats-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}

.stat-item h2 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--cic-green-light);
  margin-bottom: 4px;
}

.stat-item p {
  font-size: 0.95rem;
  color: #D1E7DD;
}

/* ==========================================================================
   NEWS & EVENTS SECTION
   ========================================================================== */
.section-news-events {
  padding: 64px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.news-events-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.news-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.news-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--cic-border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.news-card:hover {
  transform: translateY(-4px);
}

.news-img-holder {
  height: 160px;
  background-size: cover;
  background-position: center;
}

.news-content {
  padding: 20px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--cic-green-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.news-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.events-list {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--cic-border-color);
}

.event-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--cic-border-color);
}

.event-item:last-child {
  border-bottom: none;
}

.event-date-box {
  background: rgba(0, 122, 61, 0.08);
  color: var(--cic-green-primary);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 60px;
}

.event-date-box .day {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.event-date-box .month {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.event-info h5 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.event-info p {
  font-size: 0.8rem;
  color: var(--cic-text-muted);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #111B14;
  color: #A0B0A5;
  padding: 60px 24px 24px;
  font-size: 0.9rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h5 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #A0B0A5;
}

.footer-col ul li a:hover {
  color: var(--cic-green-light);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ==========================================================================
   COPILOT STUDIO CHATBOT WIDGET STYLING
   ========================================================================== */

#cic-copilot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, var(--cic-green-primary) 0%, var(--cic-green-dark) 100%);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 122, 61, 0.35);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

#cic-copilot-trigger:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 30px rgba(0, 122, 61, 0.45);
}

#cic-copilot-trigger.active .icon-copilot {
  display: none;
}

#cic-copilot-trigger .icon-close {
  display: none;
}

#cic-copilot-trigger.active .icon-close {
  display: block;
}

.trigger-badge {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

/* Floating Window */
#cic-copilot-window {
  position: fixed;
  bottom: 95px;
  right: 28px;
  width: 420px;
  height: 620px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cic-border-color);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#cic-copilot-window.copilot-window-hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

/* Header */
.copilot-header {
  background: linear-gradient(135deg, #00562B 0%, #007A3D 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copilot-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.copilot-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copilot-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.mode-badge {
  background: var(--cic-gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.copilot-subtitle {
  font-size: 0.78rem;
  opacity: 0.85;
}

.copilot-header-controls button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  padding: 4px;
  border-radius: 4px;
}

.copilot-header-controls button:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

/* Body */
.copilot-body {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #F8FAFC;
  overflow: hidden;
}

/* Settings Pane */
#copilot-settings-pane {
  position: absolute;
  inset: 0;
  background: white;
  z-index: 200;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#copilot-settings-pane.settings-pane-hidden {
  display: none;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--cic-border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-primary {
  background: var(--cic-green-primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary {
  background: #E2E8F0;
  color: var(--cic-text-dark);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Iframe */
#copilot-iframe-container {
  width: 100%;
  height: 100%;
}

#copilot-live-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Demo Chat Container */
#copilot-demo-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  max-width: 88%;
}

.user-message {
  align-self: flex-end;
}

.user-message .msg-content {
  background: var(--cic-green-primary);
  color: white;
  border-radius: 16px 16px 2px 16px;
  padding: 12px 16px;
  font-size: 0.92rem;
}

.bot-message {
  align-self: flex-start;
}

.bot-message .msg-content {
  background: white;
  color: var(--cic-text-dark);
  border-radius: 16px 16px 16px 2px;
  padding: 14px 18px;
  border: 1px solid var(--cic-border-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  font-size: 0.9rem;
}

.welcome-card {
  max-width: 100%;
}

.welcome-header h4 {
  color: var(--cic-green-primary);
  margin-bottom: 6px;
}

.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: #F0F7F3;
  color: var(--cic-green-primary);
  border: 1px solid #D0E5D9;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--cic-green-primary);
  color: white;
}

.res-badge {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.res-title {
  font-size: 1rem;
  color: var(--cic-green-primary);
  margin-bottom: 8px;
}

.res-text strong {
  color: var(--cic-green-dark);
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.msg-btn {
  background: var(--cic-green-primary);
  color: white !important;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-block;
}

.msg-btn:hover {
  background: var(--cic-green-dark);
}

/* Typing Indicator */
.typing-indicator-msg .dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator-msg .dots span {
  width: 8px;
  height: 8px;
  background: var(--cic-green-primary);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator-msg .dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator-msg .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--cic-border-color);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--cic-border-color);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--cic-green-primary);
}

.chat-input-bar button {
  background: var(--cic-green-primary);
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chat-input-bar button:hover {
  background: var(--cic-green-dark);
}

/* Footer */
.copilot-footer {
  background: #F1F5F9;
  padding: 6px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--cic-text-muted);
  border-top: 1px solid var(--cic-border-color);
}
