/* ============================================
   BitePlug - Main Stylesheet
   Shared styles used across all pages
   ============================================ */

/* CSS Variables */
:root {
  --brand: #e85d28;
  --brand-dark: #d64419;
  --brand-light: #ff7043;
  --indigo: #4F46E5;
  --green: #16A34A;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #6B7280;
  --ring: 0 0 0 4px rgba(232, 93, 40, .15);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-top: 72px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--indigo);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #EEF2F7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo-section {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-section img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.logo-section strong {
  font-family: Outfit, Inter, sans-serif;
  font-size: 22px;
  letter-spacing: .3px;
  color: var(--text);
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

nav a {
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--brand);
}

#headerButtons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 16px;
}

/* Header Buttons */
.discord-btn,
.login-btn,
.signup-btn,
.logout-btn,
.order-history-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discord-btn {
  background: #5865F2;
  color: white;
}

.discord-btn:hover {
  background: #4752C4;
  transform: translateY(-1px);
}

.login-btn {
  background: white;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.login-btn:hover {
  background: var(--brand);
  color: white;
}

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

.signup-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.logout-btn {
  background: #F3F4F6;
  color: var(--text);
}

.logout-btn:hover {
  background: #E5E7EB;
}

.order-history-btn {
  background: white;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.order-history-btn:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-1px);
}

.user-name {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group small {
  color: #6B7280;
  font-size: 13px;
  margin-top: 4px;
  display: block;
}

.required {
  color: var(--brand);
}

/* Buttons */
.submit-btn {
  background: var(--brand);
  color: white;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(232, 93, 40, 0.3);
}

.submit-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 93, 40, 0.4);
}

.submit-btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  max-width: 650px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  cursor: pointer;
  color: #9CA3AF;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #F3F4F6;
  color: #374151;
}

.modal h2 {
  color: var(--brand);
  margin-bottom: 24px;
  text-align: left;
  font-size: 28px;
}

/* Messages & Alerts */
.error-message,
.success-message {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.error-message {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid #DC2626;
}

.success-message {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid #10B981;
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  color: var(--text);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid;
}

.toast.success {
  border-left-color: var(--green);
}

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

.toast.info {
  border-left-color: var(--brand);
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.toast-close:hover {
  background: var(--bg);
  color: var(--text);
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #9CA3AF;
}

/* Footer */
footer {
  background: #0F172A;
  color: #E5E7EB;
  padding: 48px 0;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-left strong {
  font-family: Outfit, Inter, sans-serif;
  font-size: 20px;
}

.footer-tagline {
  font-size: 14px;
  color: #9CA3AF;
  margin-top: 8px;
}

.footer-copyright {
  margin-top: 8px;
  font-size: 12px;
  color: #94A3B8;
}

.footer-right {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 14px;
  align-items: center;
}

.footer-right a {
  color: #CBD5E1;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: white;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

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

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

/* Responsive - Mobile */
@media (max-width: 768px) {
  body {
    padding-top: 64px;
  }

  .header-container {
    height: 64px;
  }

  nav {
    gap: 12px;
    font-size: 14px;
  }

  nav a:not(.discord-btn):not(.login-btn):not(.signup-btn) {
    display: none;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-right {
    justify-content: center;
  }

  #toastContainer {
    right: 12px;
    left: 12px;
    top: 70px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}
