/* Dark theme CSS for Ghost Name Picker */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #111827; /* gray-900 */
  color: #ffffff;
  line-height: 1.6;
  /* Prevent layout shift from scrollbar appearing/disappearing */
  overflow-y: scroll;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Ensure header stability */
header {
  position: relative;
  width: 100%;
  /* Prevent any potential layout shifts */
  min-height: 80px;
  display: flex;
  align-items: center;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }

/* Additional header element stability */
header .container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  white-space: nowrap;
  /* Prevent text wrapping that could cause shifts */
}
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.h-full { height: 100%; }

/* Spacing */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-8 { margin-top: 2rem; }

/* Sizing */
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.h-16 { height: 4rem; }
.w-16 { width: 4rem; }
.h-24 { height: 6rem; }
.w-24 { width: 6rem; }

/* Colors */
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-purple-300 { color: #c4b5fd; }
.text-purple-400 { color: #a78bfa; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-purple-600 { background-color: #9333ea; }
.bg-purple-700 { background-color: #7c3aed; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.border-gray-800 { border-color: #1f2937; }
.border-purple-400 { border-color: #a78bfa; }

/* Borders */
.border { border: 1px solid; }
.border-b { border-bottom: 1px solid; }
.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

/* Text styles */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.no-underline { text-decoration: none; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Width constraints */
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-6xl { max-width: 72rem; }
.min-h-screen { min-height: 100vh; }

/* Hover effects */
.hover\:text-purple-300:hover { color: #c4b5fd; }
.hover\:bg-purple-400:hover { background-color: #a78bfa; }
.hover\:bg-purple-700:hover { background-color: #7c3aed; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:border-purple-400:hover { border-color: #a78bfa; }

/* Button styles */
.btn {
  /* Display & positioning */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  
  /* Box model */
  padding: 0.8rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  
  /* Typography */
  font-size: 0.875rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  
  /* Visual effects */
  transition: all 0.2s ease-in-out;
}

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

.btn-primary {
  background-color: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
}

.btn-primary:hover {
  background-color: #7c3aed;
  border-color: #7c3aed;
}

.btn-outline {
  background-color: transparent;
  color: #a78bfa;
  border-color: #a78bfa;
}

.btn-outline:hover {
  background-color: #a78bfa;
  color: #111827;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #c4b5fd;
  font-weight: 500;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #4b5563;
  border-radius: 0.375rem;
  background-color: #374151;
  color: #ffffff;
  font-size: 1rem;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

/* Card styles */
.card {
  display: flex;
  flex-direction: column;
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-description {
  color: #9ca3af;
  margin-bottom: 0.1rem;
}

.card-description-readable {
  line-height: 1.6;
}

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

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #374151;
}

.table th {
  color: #c4b5fd;
  font-weight: 600;
}

.table tr:hover {
  background-color: rgba(55, 65, 81, 0.5);
}

/* Alert styles */
.alert {
  position: relative;
  padding: 1rem;
  border: 1px solid;
  border-radius: 0.375rem;
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.1);
  border-color: #22c55e;
  color: #bbf7d0;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #fecaca;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #fde68a;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #bfdbfe;
}

.alert-close {
  /* Position */
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  z-index: 10;
  
  /* Size */
  width: 24px;
  height: 24px;
  
  /* Display */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Styling */
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}

.alert-close:hover {
  opacity: 1;
}

/* Animations */
.animate-pulse {
  animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

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

/* Mobile-first responsive design */
@media (max-width: 767px) {
  /* Mobile header - hide title text and email */
  header h1 {
    display: none;
  }
  
  header .text-sm {
    display: none !important;
  }
  
  /* Make icon clickable and properly sized on mobile */
  header svg {
    cursor: pointer;
    min-width: 2rem;
    min-height: 2rem;
  }
  
  /* Reduce header padding on mobile */
  header {
    padding: 0.75rem 1rem;
    min-height: 60px;
  }
  
  header .container {
    padding: 0 0.5rem;
  }
  
  /* Ensure logout button is properly sized */
  .btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
  }
  
  /* Mobile container adjustments */
  .container {
    padding: 0 0.75rem;
  }
  
  /* Mobile page padding */
  .p-6 {
    padding: 1rem !important;
  }
  
  /* Mobile typography adjustments */
  .text-4xl {
    font-size: 2rem !important;
  }
  
  .text-3xl {
    font-size: 1.75rem !important;
  }
  
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  /* Mobile form improvements */
  .form-input {
    font-size: 1rem; /* Prevent zoom on iOS */
  }
  
  /* Mobile ghost cards - single column */
  .results-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  /* Mobile card spacing */
  .card {
    margin: 0 0.5rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-content {
    padding: 0.75rem;
  }
  
  /* Mobile - disable tooltip interactions */
  .ghost-row {
    cursor: default;
  }
  
  .ghost-tooltip {
    display: none !important;
  }
  
  /* Mobile table - convert to cards */
  .table {
    display: none !important;
  }
  
  .mobile-name-card {
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .mobile-name-card:last-child {
    margin-bottom: 0;
  }
  
  .mobile-card-title {
    font-weight: bold;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .mobile-card-email {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  .mobile-card-date {
    color: #6b7280;
    font-size: 0.8rem;
  }
  
  /* Larger touch targets for mobile */
  .btn {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  /* Mobile icon sizing */
  .h-16.w-16 {
    height: 3rem !important;
    width: 3rem !important;
  }
  
  .h-24.w-24 {
    height: 4rem !important;
    width: 4rem !important;
  }
}

/* Tablet and desktop responsive design */
@media (min-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  
  /* Desktop table - show table, hide mobile cards */
  .table {
    display: table !important;
  }
  
  .mobile-name-cards {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Specific component styles */

/* Default: hide mobile cards on desktop */
.mobile-name-cards {
  display: none;
}

/* Mobile-first: show cards on mobile devices */
@media (max-width: 767px) {
  .mobile-name-cards {
    display: block !important;
  }
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

.form-card {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.form-container {
  min-height: calc(100vh - 80px);
}

.results-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  max-width: 72rem;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ghost-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s ease-in-out;
}

.ghost-card:hover {
  border-color: #a78bfa;
}

.form-card .btn {
  margin-top: 30px !important;
  display: block !important;
}

.ghost-card .btn {
  margin-top: 30px !important;
  display: block !important;
}

/* Ghost description tooltip - Desktop only */
@media (min-width: 768px) {
  .ghost-tooltip {
    position: absolute;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #ffffff;
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 250px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    transform: translateY(-10px);
  }

  .ghost-tooltip.visible {
    opacity: 1;
  }



  /* Hover effect for ghost rows - Desktop only */
  .ghost-row {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
  }

  .ghost-row:hover {
    background-color: rgba(107, 114, 128, 0.1) !important;
  }
}