/* ============================================
   FILE UPLOAD AREA
   ============================================ */
#drop-area {
  border: 4px dashed #0E4468;
  border-radius: 20px;
  max-width: 100%;
  width: 100%;
  font-family: sans-serif;
  margin: 20px auto;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#drop-area.highlight {
  border-color: #910720;
  background-color: rgba(145, 7, 32, 0.05);
}

#fileElem {
  display: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.button {
  display: inline-block;
  padding: 12px 24px;
  background: #910720;
  cursor: pointer;
  border-radius: 50px;
  border: none;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.button:hover {
  background: #b3354c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(145, 7, 32, 0.3);
}

.btn-primary {
  background-color: #910720 !important;
  border-color: #910720 !important;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #b3354c !important;
  border-color: #b3354c !important;
  transform: translateY(-1px);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */
.card {
  border-radius: 15px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  border: none !important;
  margin-bottom: 20px;
}

.card-header {
  background-color: transparent !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  padding: 1.25rem !important;
}

.card-body {
  padding: 1.25rem !important;
}

/* ============================================
   STAFF ITEMS
   ============================================ */
.staff-item:hover {
  background-color: whitesmoke !important;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.prompt-item {
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.prompt-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CHAT MESSAGES
   ============================================ */
.chat-message-ai {
  color: #242426;
  background-color: #E1E1E1;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
  max-width: 85%;
  width: fit-content;
  border-bottom-left-radius: 0px;
  word-wrap: break-word;
  line-height: 1.5;
}

.chat-message-user {
  color: white;
  background-color: #0E4468;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
  max-width: 85%;
  width: fit-content;
  border-bottom-right-radius: 0px;
  word-wrap: break-word;
  line-height: 1.5;
  margin-left: auto;
}

#chat_prompts p {
  transition: all 0.3s ease;
}

#chat_prompts p:hover {
  background-color: #910720 !important;
  color: white !important;
  cursor: pointer;
  transform: translateX(-5px);
}

#typing {
  max-height: 100px;
  opacity: 1;
}

@keyframes showHide {
  0%, 25% {
    opacity: 0;
  }
  30%, 70% {
    opacity: 1;
  }
  75%, 100% {
    opacity: 0;
  }
}

/* ============================================
   MODAL & SWEET ALERT
   ============================================ */
.sweet-alert button {
  background-color: #910720 !important;
}

.white-content .modal-content:not(.card-white) {
  background-color: #CAD7DF;
  border-radius: 20px !important;
}

.modal-content {
  background-color: #27293d;
  border-radius: 20px !important;
}

/* ============================================
   LETTER PROMPTS
   ============================================ */
#letter-prompts .active div {
  border: 2px solid #910720;
  box-shadow: 0 4px 12px rgba(145, 7, 32, 0.3);
}

#letter-prompts div div:hover {
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* ============================================
   SELECT & DROPDOWN
   ============================================ */
.select2-width {
  width: 100% !important;
  max-width: 300px;
}

.dropdown-navbar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
textarea {
  border: 1px solid rgba(29, 37, 59, 0.2) !important;
  border-radius: 8px !important;
  transition: border-color 0.3s ease;
}

textarea:focus {
  border-color: #910720 !important;
  box-shadow: 0 0 0 0.2rem rgba(145, 7, 32, 0.15) !important;
}

.form-control {
  border-radius: 8px !important;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #910720 !important;
  box-shadow: 0 0 0 0.2rem rgba(145, 7, 32, 0.15) !important;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08) !important;
  width: 220px !important;
  display: block !important;
  transition: all 0.3s ease;
}

@media (max-width: 991.98px) {
  .sidebar {
    width: 260px !important;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  }

  /* Add overlay when sidebar is open */
  body.nav-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
  }

  /* Ensure main content is not affected */
  .main-panel {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Show hamburger menu on mobile */
  .navbar-toggle {
    display: block !important;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.extracting {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   EDIT MODE
   ============================================ */
div.editMode {
  background-color: #910720 !important;
  color: white !important;
}

/* ============================================
   RESPONSIVE LAYOUT FIXES
   ============================================ */
@media (max-width: 1199.98px) {
  .col-md-8, .col-md-4 {
    max-width: 100%;
    flex: 0 0 100%;
  }

  .card {
    margin-bottom: 20px;
  }
}

@media (max-width: 767.98px) {
  .button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .card-header .d-flex {
    flex-direction: column !important;
    gap: 10px;
  }

  .card-header .btn {
    width: 100% !important;
    margin: 5px 0 !important;
  }

  #chat-history {
    height: 50vh !important;
  }

  .chat-message-ai,
  .chat-message-user {
    max-width: 90% !important;
    font-size: 14px;
  }
}

@media (max-width: 575.98px) {
  .content {
    padding: 10px !important;
  }

  .row {
    margin-left: -10px;
    margin-right: -10px;
  }

  .col, [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sticky-top {
  position: sticky;
  top: 10px;
  z-index: 100;
}

.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
#loading-overlay {
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
}

/* ============================================
   TAG SYSTEM
   ============================================ */
.badge {
  font-weight: 500 !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
}

.close-icon {
  font-weight: bold;
  transition: transform 0.2s ease;
}

.close-icon:hover {
  transform: scale(1.2);
}

/* ============================================
   FILE INFORMATION CARD
   ============================================ */
#upload-image-container img {
  border-radius: 8px;
  object-fit: cover;
}

#file-name a {
  transition: color 0.3s ease;
}

#file-name a:hover {
  color: #910720 !important;
}

/* ============================================
   FROALA EDITOR FIXES
   ============================================ */
.fr-box.fr-basic .fr-element {
  min-height: 400px !important;
  padding: 20px !important;
}

.fr-toolbar {
  border-radius: 10px 10px 0 0 !important;
}

.fr-wrapper {
  border-radius: 0 0 10px 10px !important;
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */
@media (max-width: 767.98px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 12px !important;
  }

  th, td {
    padding: 8px 4px !important;
  }
}