/* ==========================================================================
   SillyHost - Custom Styles
   Fun & Friendly Hosting Platform
   ========================================================================== */

/* ---------- Base & Resets ---------- */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c4b5fd;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7c3aed;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #c4b5fd #f1f5f9;
}

/* ---------- Animation Keyframes ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

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

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-12px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

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

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-slide-down { animation: slideDown 0.3s ease-out; }
.animate-bounce-slow { animation: bounce 2s infinite; }
.animate-wiggle { animation: wiggle 1s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #0f766e, #115e59);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(0);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.575rem 1.5rem;
  background: transparent;
  color: #7c3aed;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: 2px solid #7c3aed;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline:hover {
  background: #7c3aed;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

/* ---------- Card ---------- */
.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.card-static {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* ---------- Gradient Backgrounds ---------- */
.gradient-bg {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 30%, #0d9488 100%);
}

.gradient-bg-soft {
  background: linear-gradient(135deg, #f5f3ff 0%, #f0fdfa 100%);
}

.gradient-text {
  background: linear-gradient(135deg, #7c3aed, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Glass Effect ---------- */
.glass-effect {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
}

.glass-effect-dark {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e9d5ff;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 56px;
  height: 56px;
  border-width: 5px;
}

/* ---------- Chat Bubbles (AI Builder) ---------- */
.chat-user {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.75rem 1rem;
  max-width: 80%;
  margin-left: auto;
  animation: slideUp 0.3s ease-out;
  word-wrap: break-word;
}

.chat-ai {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.75rem 1rem;
  max-width: 80%;
  margin-right: auto;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  word-wrap: break-word;
}

.chat-ai .typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.chat-ai .typing-indicator span {
  width: 6px;
  height: 6px;
  background: #a78bfa;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.chat-ai .typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-ai .typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ---------- DNS Record Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-a {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-aaaa {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-cname {
  background: #ccfbf1;
  color: #0f766e;
}

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

.badge-txt {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-ns {
  background: #dbeafe;
  color: #1e40af;
}

.badge-srv {
  background: #fce7f3;
  color: #9d174d;
}

.badge-caa {
  background: #d1fae5;
  color: #065f46;
}

/* ---------- AI Builder Split Layout ---------- */
.builder-container {
  display: flex;
  height: calc(100vh - 4rem);
  overflow: hidden;
}

.builder-chat {
  width: 400px;
  min-width: 360px;
  max-width: 500px;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
}

.builder-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.builder-chat-input {
  border-top: 1px solid #e5e7eb;
  padding: 1rem;
  background: #fff;
}

.builder-preview {
  flex: 1;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.builder-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .builder-container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 4rem);
  }

  .builder-chat {
    width: 100%;
    min-width: unset;
    max-width: unset;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .builder-preview {
    height: 50vh;
  }
}

/* ---------- Status Indicators ---------- */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.online::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-dot.maintenance {
  background: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ---------- Toast Notifications ---------- */
.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 280px;
  max-width: 400px;
}

.toast-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.toast-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast-exit {
  animation: fadeOut 0.3s ease-in forwards;
}

/* ---------- Fun Hover Effects ---------- */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.hover-grow {
  transition: transform 0.2s ease;
}

.hover-grow:hover {
  transform: scale(1.03);
}

.hover-wiggle:hover {
  animation: wiggle 0.4s ease-in-out;
}

/* ---------- Flash Messages ---------- */
.flash-message {
  animation: slideDown 0.4s ease-out;
}

/* ---------- Pricing Card Highlight ---------- */
.pricing-popular {
  position: relative;
  border: 2px solid #7c3aed;
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.pricing-popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Form Styles ---------- */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: #fff;
  outline: none;
}

.form-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input:hover {
  border-color: #c4b5fd;
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

/* ---------- Confirm Dialog ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 640px) {
  .card {
    border-radius: 0.75rem;
  }

  .btn-primary,
  .btn-secondary,
  .btn-accent {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 2rem);
  }
}

/* ---------- Selection Color ---------- */
::selection {
  background: #c4b5fd;
  color: #1f2937;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Print Styles ---------- */
@media print {
  nav, footer, .flash-message, #toast-container {
    display: none !important;
  }
}
