/* Global Styles for myslf.ai */

/* Container */
.container-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-hover {
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-hover:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: #111827;
  color: white;
}

.btn-primary:hover {
  background: var(--gray-700, #6b6560);
}

.btn-primary:disabled {
  background: var(--gray-400, #b0aaa4);
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: #111827;
  border: 1px solid var(--gray-300, #c5c0b8);
}

.btn-secondary:hover {
  background: var(--gray-50, #f5f2ee);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #2d9f5f;
  color: white;
}

.btn-success:hover {
  background: #1a7a40;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-admin {
  background: #fef3c7;
  color: #92400e;
}

.badge-premium {
  background: rgba(196,90,60,0.1);
  color: #c45a3c;
}

.badge-user {
  background: #ecfdf5;
  color: #14532d;
}

.badge-free {
  background: var(--gray-200, #d7d2cb);
  color: var(--gray-700, #6b6560);
}

.badge-subscriber {
  background: rgba(196,90,60,0.1);
  color: #c45a3c;
}

.badge-customer {
  background: rgba(196,90,60,0.1);
  color: #c45a3c;
}

/* Upload Box */
.upload-box {
  border: 2px dashed var(--gray-300, #c5c0b8);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--gray-50, #f5f2ee);
}

.upload-box:hover {
  border-color: var(--gray-400, #b0aaa4);
  background: var(--gray-100, #e8e5e0);
}

.upload-box.has-file {
  border-color: #2d9f5f;
  background: #e8f5ec;
}

.upload-box.drag-over {
  border-color: #c45a3c;
  background: rgba(196,90,60,0.1);
}

/* Preview Image */
.preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 0.5rem;
  object-fit: contain;
}

/* Result Image */
.result-image {
  max-width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--gray-200, #d7d2cb);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #111827;
  transition: width 0.3s ease;
  border-radius: 9999px;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 12rem;
  padding: 0.5rem 0;
  z-index: 50;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--gray-700, #6b6560);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--gray-100, #e8e5e0);
  color: #111827;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}

.modal {
  background: white;
  border-radius: 0.75rem;
  max-width: 28rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.modal-body {
  color: var(--gray-500, #9a9590);
  margin-bottom: 1.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
}

.toast {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
  border-left: 4px solid #111827;
}

.toast.success {
  border-left-color: #2d9f5f;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.info {
  border-left-color: #3b82f6;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Utility Classes */
.text-muted {
  color: var(--gray-500, #9a9590);
}

.text-danger {
  color: #ef4444;
}

.text-success {
  color: #2d9f5f;
}

.text-warning {
  color: #f59e0b;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500, #9a9590);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200, #d7d2cb);
  background: var(--gray-50, #f5f2ee);
}

.table tbody tr {
  border-bottom: 1px solid var(--gray-100, #e8e5e0);
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background: var(--gray-50, #f5f2ee);
}

.table td {
  padding: 1rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

/* Column widths for admin table */
.table th:nth-child(1) { width: 18%; } /* Email */
.table th:nth-child(2) { width: 12%; } /* Name */
.table th:nth-child(3) { width: 10%; } /* Role */
.table th:nth-child(4) { width: 10%; } /* Status */
.table th:nth-child(5) { width: 12%; } /* Created */
.table th:nth-child(6) { width: 12%; } /* Last Login */
.table th:nth-child(7) { width: 16%; } /* IP & Country */
.table th:nth-child(8) { width: 10%; } /* Actions */

/* Actions menu - ensure it doesn't get cut off */
.table td:last-child {
  position: relative;
  overflow: visible !important;
}

.actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--gray-200, #d7d2cb);
  min-width: 12rem;
  z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
  .container-app {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}
