/* Modal Dialog - DM Modal Button Styles */

/* Cancel Button Styling */
#dmCancelBtn {
  padding: 4px 10px;
  min-width: 70px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

#dmCancelBtn:hover {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

#dmCancelBtn:active {
  background-color: #d1d5db;
}

#dmCancelBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Submit/Send Button Styling */
#dmSubmitBtn {
  padding: 4px 10px;
  min-width: 70px;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: #3b82f6;
  border: 1px solid #2563eb;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

#dmSubmitBtn:hover:not(:disabled) {
  background: #2563eb;
  border-color: #1d4ed8;
}

#dmSubmitBtn:active:not(:disabled) {
  background: #1d4ed8;
}

#dmSubmitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state */
#dmSubmitBtn.loading {
  position: relative;
}

#dmSubmitBtn.loading .lbl {
  visibility: hidden;
}

#dmSubmitBtn.loading::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Focus/Accessibility */
#dmCancelBtn:focus,
#dmSubmitBtn:focus {
  outline: 1px solid #3b82f6;
  outline-offset: 1px;
}

#dmCancelBtn:focus:not(:focus-visible),
#dmSubmitBtn:focus:not(:focus-visible) {
  outline: none;
}

/* Profile Action Buttons Styling */
.open-dm-modal-btn,
.author-subscribe-btn {
  padding: 4px 10px;
  min-width: 70px;
  height: 32px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: #3b82f6;
  border: 1px solid #2563eb;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.open-dm-modal-btn:hover,
.author-subscribe-btn:hover {
  background: #2563eb;
  border-color: #1d4ed8;
	color: #ffffff;
}

.open-dm-modal-btn:active,
.author-subscribe-btn:active {
  background: #1d4ed8;
	color: #ffffff;
}

.open-dm-modal-btn:disabled,
.author-subscribe-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Subscribe Button - Alternative Style */
.author-subscribe-btn.subscribed {
  background: #8b5cf6;
  border-color: #7c3aed;
	color: #ffffff;
}

.author-subscribe-btn.subscribed:hover {
  background: #7c3aed;
  border-color: #6d28d9;
	color: #ffffff;
}

.author-subscribe-btn.subscribed:active {
  background: #6d28d9;
	color: #ffffff;
}

/* Focus/Accessibility */
.open-dm-modal-btn:focus,
.author-subscribe-btn:focus {
  outline: 1px solid #3b82f6;
  outline-offset: 1px;
}

.open-dm-modal-btn:focus:not(:focus-visible),
.author-subscribe-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Validation styles */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.dm-error {
    display: none;
    color: #b91c1c;
    font-size: 12px;
    margin-top: 4px;
}

.dm-hint {
    font-size: 11px;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
}

/* Modal styles */
.dm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 2100 !important;
}

.modal-inner {
    max-width: 520px;
    margin: 10vh auto;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Close button styling */
.close-dm-modal {
    font-size: 20px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    background: none;
    border: none;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close-dm-modal:hover {
    color: #333;
    background-color: #f3f4f6;
}

.close-dm-modal i {
    font-size: 18px;
}

/* User status area styles */
.user-status-area {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.user-status-area.hidden {
    display: none !important;
}
