/* CryptoMessager Enterprise Styles */

:root {
  --primary-color: #3b82f6;
  --primary-dark: #1d4ed8;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

/* Dark mode styles */
.dark {
  color-scheme: dark;
}

/* Custom scrollbar */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #6b7280 #374151;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: #374151;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: #6b7280;
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* Loading animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  transition: all 0.3s ease;
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--error-color);
}

.toast.warning {
  background-color: var(--warning-color);
}

.toast.info {
  background-color: var(--primary-color);
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: flex;
  items-center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal.show {
  transform: scale(1);
}

.dark .modal {
  background: #1f2937;
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .form-input {
  background: #374151;
  border-color: #4b5563;
  color: white;
}

.dark .form-input:focus {
  border-color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

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

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #4b5563;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-online {
  background-color: var(--success-color);
}

.status-offline {
  background-color: #6b7280;
}

.status-busy {
  background-color: var(--error-color);
}

.status-away {
  background-color: var(--warning-color);
}

/* Encryption indicator */
.encryption-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background-color: rgba(34, 197, 94, 0.1);
  color: #059669;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.dark .encryption-badge {
  background-color: rgba(34, 197, 94, 0.2);
  color: #10b981;
}

/* Chat message bubbles */
.message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  position: relative;
}

.message-bubble.own {
  background-color: var(--primary-color);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.message-bubble.other {
  background-color: #f3f4f6;
  color: #111827;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.dark .message-bubble.other {
  background-color: #374151;
  color: #f9fafb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal {
    margin: 20px;
    max-width: calc(100vw - 40px);
  }
  
  .message-bubble {
    max-width: 85%;
  }
  
  .btn {
    padding: 10px 20px;
  }
}