/* ================================
   CAKE FOREVER - GLOBAL STYLES
   Mobile-First Design
   Theme: Pink, White, Cream, Cherry Red
   ================================ */

:root {
  /* Brand Colors */
  --primary-pink: #ff69b4;
  --dark-pink: #ff1493;
  --light-pink: #ffb6c1;
  --cream: #fffaf0;
  --white: #ffffff;
  --cherry-red: #dc143c;

  /* Neutrals */
  --gray-light: #f5f5f5;
  --gray-medium: #9e9e9e;
  --gray-dark: #424242;
  --black: #212121;

  /* Gradients */
  --gradient-pink: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
  --gradient-cream: linear-gradient(135deg, #fffaf0 0%, #ffe4e1 100%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(255, 105, 180, 0.1);
  --shadow-md: 0 4px 8px rgba(255, 105, 180, 0.15);
  --shadow-lg: 0 8px 16px rgba(255, 105, 180, 0.2);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50px;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
}

/* ================================
   RESET & BASE STYLES
   ================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--cream);
  color: var(--black);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* ================================
   LAYOUT
   ================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

/* ================================
   HEADER & NAVIGATION
   ================================ */

.header {
  position: sticky;
  top: 0;
  background: var(--gradient-pink);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  z-index: 1001;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 4px;
  object-fit: contain;
}

.brand-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--white);
  display: none;
}

/* Hamburger Menu Button */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
  transition: all 0.3s ease;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--white);
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Sliding Navigation Menu */
.nav-links {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg,
    var(--pink) 0%,
    var(--dark-pink) 50%,
    var(--pink) 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  padding: 80px 0 20px 0;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.nav-links::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0.6;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.nav-links.active {
  right: 0;
}

.nav-link {
  color: var(--white);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: 0;
  font-weight: 500;
  font-size: var(--font-size-md);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  display: block;
  background: transparent;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--white);
  padding-left: calc(var(--spacing-xl) + 8px);
  transform: none;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-badge {
  position: relative;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--cherry-red);
  color: var(--white);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ================================
   BUTTONS
   ================================ */

.btn {
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-md);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-align: center;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-pink);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: var(--white);
  color: var(--primary-pink);
  border: 2px solid var(--primary-pink);
}

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

.btn-danger {
  background: var(--cherry-red);
  color: var(--white);
}

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

.btn-small {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

.btn-block {
  width: 100%;
  display: flex;
}

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

/* ================================
   CARDS
   ================================ */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card-body {
  padding: var(--spacing-sm);
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--black);
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

.card-text {
  font-size: var(--font-size-xs);
  color: var(--gray-dark);
  margin-bottom: var(--spacing-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary-pink);
  margin-bottom: var(--spacing-sm);
}

.card-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--gray-light);
}

/* ================================
   FORMS
   ================================ */

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  transition: all 0.3s ease;
  background: var(--white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

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

.form-error {
  color: var(--cherry-red);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

/* ================================
   ALERTS & MESSAGES
   ================================ */

.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* ================================
   TABLES
   ================================ */

.table-container {
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.table thead {
  background: var(--gradient-pink);
  color: var(--white);
}

.table th,
.table td {
  padding: var(--spacing-md);
  text-align: left;
  font-size: var(--font-size-sm);
}

.table th {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr {
  border-bottom: 1px solid var(--gray-light);
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: var(--gray-light);
}

.table tbody tr:last-child {
  border-bottom: none;
}

/* ================================
   GRID SYSTEM
   ================================ */

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ================================
   MODAL
   ================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--spacing-md);
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-pink);
}

.modal-close {
  background: none;
  font-size: var(--font-size-xl);
  color: var(--gray-medium);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--gray-light);
  color: var(--black);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--gray-light);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* ================================
   LOADING SPINNER
   ================================ */

.spinner {
  border: 4px solid var(--gray-light);
  border-top: 4px solid var(--primary-pink);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: var(--spacing-xl) auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

/* ================================
   UTILITY CLASSES
   ================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.text-pink { color: var(--primary-pink); }
.text-cherry { color: var(--cherry-red); }
.text-gray { color: var(--gray-medium); }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }

/* ================================
   FOOTER
   ================================ */

.footer {
  background: var(--gradient-pink);
  color: var(--white);
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  margin-top: var(--spacing-xl);
}

.footer-text {
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-sm);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (min-width: 768px) {
  .brand-name {
    display: block;
  }

  .nav-links {
    flex-wrap: nowrap;
  }

  .nav-link {
    font-size: var(--font-size-md);
  }

  .card-img {
    height: 250px;
  }
}

/* ================================
   CONSOLE VIEWER (GLOBAL)
   ================================ */

#console-viewer-btn {
  position: fixed;
  bottom: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--gradient-pink);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 600;
  z-index: 9999;
  transition: all 0.2s ease;
  opacity: 0.7;
}

#console-viewer-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

#console-viewer-panel {
  position: fixed;
  bottom: 40px;
  right: 10px;
  width: 350px;
  height: 250px;
  background: var(--black);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#console-viewer-panel.active {
  display: flex;
}

.console-header {
  background: var(--gradient-pink);
  color: var(--white);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.console-header h3 {
  font-size: 13px;
  font-weight: 700;
}

.console-actions {
  display: flex;
  gap: 5px;
}

.console-action-btn {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  transition: all 0.3s ease;
}

.console-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.console-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #0f0;
  background: #000;
}

.console-log {
  margin-bottom: var(--spacing-xs);
  word-wrap: break-word;
}

.console-log.error {
  color: #ff6b6b;
}

.console-log.warn {
  color: #ffa500;
}

.console-log.info {
  color: #4da6ff;
}

/* ================================
   ANIMATIONS
   ================================ */

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

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

.fade-in {
  animation: fadeIn 0.5s ease;
}

.slide-up {
  animation: slideUp 0.5s ease;
}

/* ================================
   MAINTENANCE MODE OVERLAY
   ================================ */

.maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ff69b4;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.maintenance-content {
  text-align: center;
}

.maintenance-title {
  font-size: 3rem;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

/* Hide all other elements in maintenance overlay */
.maintenance-overlay .maintenance-particles,
.maintenance-overlay .maintenance-cake,
.maintenance-overlay .maintenance-subtitle,
.maintenance-overlay .maintenance-description,
.maintenance-overlay .maintenance-progress,
.maintenance-overlay .maintenance-contact {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .maintenance-title {
    font-size: 1.8rem;
    letter-spacing: 0.3rem;
  }
}
