/* =============================================
   Employee Notes Modal (Enhanced with Notifications)
   ============================================= */

/* Modal Overlay */
.notes-modal-overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.notes-modal-overlay.active {
  display: flex;
}

/* Modal Container */
.notes-modal {
  background: #fff;
  border-radius: 16px;
  width: 95%;
  max-width: 700px;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0 auto;
  position: relative;
}

/* Modal Header */
.notes-modal-header {
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-modal-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}

/* Close Button */
.close-modal-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 26px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-modal-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* Modal Body */
.notes-modal-body {
  padding: 8px 30px;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}

/* Form Section */
.forms-section {
  margin-bottom: 25px;
}

.forms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.forms-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.forms-group {
  margin-bottom: 0px;
}

.forms-group.full-width {
  grid-column: 1 / -1;
}

.forms-group label {
  display: block;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
  font-size: 14px;
}

.forms-group input,
.forms-group select,
.forms-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.forms-group textarea {
  resize: vertical;
  min-height: 100px;
}

.forms-group input:focus,
.forms-group select:focus,
.forms-group textarea:focus {
  outline: none;
  border-color: #c9b25f;
  box-shadow: 0 0 0 3px rgba(201,178,95,0.15);
}

/* Form Actions */
.forms-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(60,68,76,0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Divider */
.divider {
  margin: 20px 0;
  border: none;
  border-top: 2px solid #e9ecef;
}

/* Notes List Section */
.notes-list-section {
  margin-top: 0px;
}

.notes-list-section h3 {
  margin-bottom: 10px;
  color: #333;
  font-size: 18px;
}

.notes-list {
  border-top: 1px solid #eee;
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
  background: #fafafa;
  border-radius: 8px;
}

.notes-list strong {
  color: #333;
}

.notes-list small {
  color: #999;
}

/* =============================================
   Notification & Attention Styles
   ============================================= */

/* Notification Badge on Button */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4444;
  color: white;
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s infinite;
  box-shadow: 0 2px 6px rgba(255,68,68,0.4);
  z-index: 10;
}

/* Latest Note Box */
.employee-latest-note {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.employee-latest-note:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.employee-latest-note.has-unread {
  border-left: 4px solid #ff4444;
  animation: attention 2s infinite;
}

.employee-latest-note.has-unread::before {
  content: "🔔 NEW";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4444;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

.latest-note-header {
  font-weight: 600;
  color: #3c444c;
  margin-bottom: 10px;
  font-size: 16px;
}

.latest-note-body {
  color: #555;
}

/* Message Styles */
.note-message {
  position: relative;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.note-message:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.note-message.message-sent {
  background: #e3f2fd;
  border-left: 3px solid #2196F3;
}

.note-message.message-received {
  background: #f5f5f5;
  border-left: 3px solid #9e9e9e;
}

.attention-note {
  background: #fff9e6 !important;
  border-left: 3px solid #c9b25f !important;
  box-shadow: 0 2px 8px rgba(201,178,95,0.2);
}

.note-item {
  padding: 0px;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.note-item:hover {
  background: #e9ecef;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.note-time {
  margin-bottom: 8px;
}

.note-content {
  color: #555;
  line-height: 1;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Success Message */
.success-message {
  display: inline-block;
  margin-left: 10px;
  padding: 8px 15px;
  background: #4CAF50;
  color: white;
  border-radius: 6px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from { 
    opacity: 0; 
  }
  to { 
    opacity: 1; 
  }
}

@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

@keyframes attention {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  50% {
    box-shadow: 0 2px 12px rgba(255,68,68,0.4);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scrollbar Styling */
.notes-list::-webkit-scrollbar {
  width: 8px;
}

.notes-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.notes-list::-webkit-scrollbar-thumb {
  background: #c9b25f;
  border-radius: 4px;
}

.notes-list::-webkit-scrollbar-thumb:hover {
  background: #b8a050;
}

.notes-modal-body::-webkit-scrollbar {
  width: 8px;
}

.notes-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.notes-modal-body::-webkit-scrollbar-thumb {
  background: #c9b25f;
  border-radius: 4px;
}

.notes-modal-body::-webkit-scrollbar-thumb:hover {
  background: #b8a050;
}

/* Button Position for Badge */
#openNotesBtn {
  position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
  .notes-modal {
    width: 98%;
    max-width: none;
    margin: 10px;
  }
  
  .notes-modal-body {
    padding: 15px 20px;
  }
  
  .forms-row {
    grid-template-columns: 1fr;
  }
  
  .notes-modal-header {
    padding: 15px 20px;
  }
  
  .notes-modal-header h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .notes-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .notes-modal-body {
    padding: 15px;
  }
}



/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ── Hide legacy latest note box (replaced by schedule widget) ── */
#latestNoteBox,
.employee-latest-note {
  display: none !important;
}

/* ── Schedule widget new-message pulse ── */
.dr-msg-card.dr-msg-new {
  border-color: #c9b25f !important;
  animation: drMsgPulse 1.8s ease-in-out 3;
}

@keyframes drMsgPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,178,95,0); }
  50%       { box-shadow: 0 0 0 6px rgba(201,178,95,0.35); }
}

/* ── New message dot indicator on widget title ── */
.dr-msg-new-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #e53935;
  border-radius: 50%;
  margin-left: 6px;
  animation: pulse 1.5s infinite;
  vertical-align: middle;
  flex-shrink: 0;
}


    border: 2px solid #c9b25f !important;
    box-shadow: 0 0 20px rgba(201, 178, 95, 0.4) !important;
}

.attention-note {
    background: #fff9e6;
    border-left: 4px solid #c9b25f;
    padding: 12px;
    border-radius: 8px;
}