/* =====================
   Reset & Base
===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #f9f9f9;
  color: #2d3748;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

/* =====================
   Header & Footer
===================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 30px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 40px;
  cursor: pointer;
}

.logo .caption {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.logo:hover .caption {
  opacity: 1;
  transform: translateX(0);
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  max-width: 700px;
}

.toolbar-center input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  background: #fff;
}

.toolbar-center input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
}

.lang-switcher button {
  background: #f1f3f5;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-switcher button:hover {
  background: #e0e0e0;
}

.lang-switcher button.active {
  background: #2176bd;
  color: #fff;
  border: 2px solid #1b5c92;
}

.lang-switcher button:focus {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

.footer {
  text-align: center;
  padding: 15px;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  color: #2d3748;
  font-size: 14px;
  margin-top: 40px;
}

/* =====================
   Portfolio Grid
===================== */
/* Portfolio Grid Layout - Clean Flexbox */
#portfolio-canvas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#portfolio-canvas .portfolio-item {
  flex: 0 0 calc(25% - 16px);   /* 4 per row on desktop */
  max-width: calc(25% - 16px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eaeaea;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Tablet: 3 per row */
@media (max-width: 1100px) {
  #portfolio-canvas .portfolio-item {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
  }
}

/* Small tablets: 2 per row */
@media (max-width: 768px) {
  #portfolio-canvas .portfolio-item {
    flex: 0 0 calc(50% - 16px);
    max-width: calc(50% - 16px);
  }
}

/* Mobile: 1 per row */
@media (max-width: 480px) {
  #portfolio-canvas .portfolio-item {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

#portfolio-canvas .portfolio-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}


.portfolio-item {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #eaeaea;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.portfolio-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 26px rgba(0,0,0,0.2);
  border-color: #3498db;
}

.portfolio-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform .3s ease-in-out;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

.portfolio-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.25));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-item:hover::after {
  opacity: 1;
}

.portfolio-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 8px;
  font-size: 0.9em;
  text-align: center;
  z-index: 2;
}

.badge-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #ffcc00;
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}

.badge-featured::before {
  content: "★";
  font-size: 0.9rem;
}

/* ✅ Contact Tile */
.contact-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  background: #f9fafb;
  border: 2px dashed #3498db;
  color: #2d3748;
  text-align: center;
}

/* =====================
   Filters (Dropdowns + Chips)
===================== */
.filter-group {
  position: relative;
}

.filter-toggle {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-toggle:hover {
  background: #f1f3f5;
}

.dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  z-index: 200;
}

.dropdown.hidden {
  display: none;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-btn {
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1px solid #ccc;
  background: #f1f3f5;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: #e0e0e0;
}

.chip-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #2980b9;
}

/* =====================
   Modal (Generic)
===================== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 2000;
}

.modal.hidden { display: none; }
.modal.show { display: flex; opacity: 1; pointer-events: auto; }

.modal-content {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  position: relative;
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #444;
}

/* =====================
   About Modal (Overrides)
===================== */
#about-modal .modal-content {
  max-width: 720px;
  padding: 2rem 2.5rem;
  background: #fffdf7;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
  color: #222;
  max-height: 90vh;
  overflow-y: auto;
}

#about-modal h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1rem;
}

#about-modal p { margin-bottom: 1rem; text-align: justify; }
#about-modal em { font-style: italic; color: #444; }
#about-modal strong { font-weight: bold; color: #111; }
#about-modal hr { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }
#about-modal h3 { font-size: 1.3rem; margin-bottom: 0.8rem; border-bottom: 1px dashed #aaa; padding-bottom: 0.3rem; }
#about-projects { list-style: none; padding-left: 0; }
#about-projects li { margin: 0.4rem 0; font-size: 1rem; }
#about-projects a { color: #333; text-decoration: none; border-bottom: 1px dashed #999; transition: color 0.2s ease; }
#about-projects a:hover { color: #2176bd; }

/* =====================
   Mobile Responsiveness
===================== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-center {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
    gap: 8px;
  }

  #portfolio-canvas {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 10px;
  }

  .portfolio-meta { font-size: 0.75em; padding: 4px; }
  .dropdown { min-width: 180px; max-height: 200px; }
}

main { padding-top: 10px; }

/* =====================
   Chatbot (Clean)
===================== */

/* Floating trigger button */
#chat-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
}

#chat-toggle {
  background: #2176bd;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}
#chat-toggle:hover { background: #155a8a; transform: scale(1.05); }

/* Chat popup */
#chat-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2100;
  font-family: "Segoe UI", Roboto, sans-serif;
}
#chat-window.hidden { display: none; }

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #2176bd, #3498db);
  color: #fff;
  padding: 12px 16px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
.chat-title { font-weight: 600; font-size: 15px; }
.chat-subtitle { font-size: 12px; opacity: 0.9; }
#chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 14px;
  background: #f9fafc;
}

/* Messages */
.chat-line { display: flex; align-items: flex-start; margin: 6px 0; }
.chat-line.user { justify-content: flex-end; }
.chat-avatar {
  width: 32px; height: 32px; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 8px;
}
.chat-line.user .chat-avatar { order: 2; }
.chat-message {
  max-width: 70%; padding: 10px 14px;
  border-radius: 16px; line-height: 1.4;
  font-size: 14px; word-wrap: break-word;
}
.chat-line.user .chat-message {
  background: #3498db; color: #fff;
  border-bottom-right-radius: 4px; margin-left: 8px;
}
.chat-line.bot .chat-message {
  background: #f1f1f1; color: #333;
  border-bottom-left-radius: 4px; margin-right: 8px;
}
.chat-message a { color: #2176bd; font-weight: 600; text-decoration: underline; }

/* Input */
.chat-input-row {
  display: flex; gap: 8px;
  padding: 10px; border-top: 1px solid #eee;
  background: #fff;
}
#chat-input {
  flex: 1; padding: 8px 10px;
  border: 1px solid #ddd; border-radius: 8px;
}
#chat-send {
  padding: 8px 14px;
  border: none; background: #2176bd; color: #fff;
  border-radius: 8px; cursor: pointer; font-weight: 600;
}
#chat-send:hover { background: #155a8a; }

/* Controls */
#chat-controls {
  padding: 8px 10px;
  border-top: 1px solid #eee;
  text-align: right; background: #fff;
}
#chat-reset {
  background: #e74c3c; color: #fff;
  border: none; border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
  font-size: 13px;
}
#chat-reset:hover { background: #c0392b; }

/* Spinner */
#chat-spinner {
  font-style: italic;
  color: #666;
  padding: 6px;
  text-align: left;
}

/* =====================
   Portfolio Header
===================== */
.portfolio-header {
  text-align: center;
  margin: 40px auto 20px auto;
  max-width: 800px;
  padding: 0 15px;
}

.portfolio-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2d3748;
}

.portfolio-header p {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 600px;
}

/* =====================
   Filter State
===================== */
.filter-group.active-filter > button,
.filter-toggle.active-filter {
  background-color: #007BFF;
  color: #fff;
}
.filter-toggle.is-active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}
/* =====================
   Detail Page Formatting
===================== */

.description {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  color: #2d3748;
}

.description ul,
.description ol {
  margin-left: 1.5rem;        /* indentation */
  margin-bottom: 1rem;
  padding-left: 1.2rem;
  list-style-position: outside;
}

.description ul {
  list-style-type: disc;      /* solid dots */
}

.description ol {
  list-style-type: decimal;   /* numbered list */
}

.description li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

/* Optional: make nested lists look better */
.description ul ul,
.description ol ol {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  list-style-type: circle;
}

/* If you use multi-column layouts */
.description.multi-col {
  column-count: 1;  /* or 2 if you like the split layout */
  column-gap: 2rem;
}
.description ul li::marker {
  color: #2176bd; /* your accent blue */
  font-size: 1.1em;
}
/* =====================
   📱 Mobile Chatbot Fixes
===================== */

/* Make chat window fill the screen height properly */
@media (max-width: 768px) {
  #chat-window {
    width: 100vw;                /* full screen width */
    height: 100vh;               /* full screen height */
    max-height: none;
    right: 0;
    bottom: 0;
    border-radius: 0;            /* remove rounded corners */
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  .chat-header {
    padding: 14px;
    font-size: 15px;
  }

  #chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
  }

  .chat-input-row {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
  }

  #chat-input {
    flex: 1;
    font-size: 16px;
    padding: 10px;
    border-radius: 8px;
  }

  #chat-send {
    padding: 10px 16px;
    font-size: 15px;
  }

  .chat-controls {
    text-align: center;
    padding: 8px 10px 12px;
  }

  #chat-reset {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }

  /* Floating trigger button reposition */
  #chat-trigger {
    bottom: 10px;
    right: 10px;
  }

  #chat-toggle {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Optional: prevent the screen from scrolling behind the chat window */
body.chat-open {
  overflow: hidden;
}
