/* ============================================================
   Claudia's Cake Creations - Purple Theme
   Matching claudiascakecreations.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap');

:root {
  --primary: #7b2cbf;
  --secondary: #9d4edd;
  --accent: #c77dff;
  --accent-light: #e0aaff;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #f8f7ff;
  --white: #ffffff;
  --border: #e0e0e0;
  --green: #6BAF6B;
  --green-light: #E8F5E8;
  --red: #D44;
  --red-light: #FDE8E8;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
  --radius: 10px;
  --radius-sm: 5px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin-bottom: 0;
}

/* ---- Header ---- */
.header {
  background: linear-gradient(135deg, rgba(80, 20, 140, 0.95), rgba(100, 40, 160, 0.95));
  color: var(--white);
  padding: 1.5rem 1rem;
  text-align: center;
}

.header h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  font-weight: 700;
}

.header .tagline {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.3rem;
  font-weight: 300;
}

/* ---- Birthday Cookie Banner ---- */
.birthday-banner {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  padding: 0.8rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--white);
  font-weight: 500;
}

.birthday-banner strong {
  color: var(--white);
}

/* ---- Container ---- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ---- Calendar ---- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.btn-gold {
  background: var(--secondary);
  color: var(--white);
}

.btn-gold:hover:not(:disabled) {
  background: var(--primary);
}

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

.btn-danger:hover:not(:disabled) {
  background: #b33;
}

.btn-success {
  background: var(--green);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  background: #5a9e5a;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid .day-label {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.calendar-day {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-height: 90px;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: var(--shadow);
}

.calendar-day:hover:not(.past):not(.empty) {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.calendar-day.today {
  border-color: var(--primary);
  background: var(--bg-light);
}

.calendar-day.past {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.calendar-day.empty {
  background: transparent;
  cursor: default;
  box-shadow: none;
}

.calendar-day .day-number {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}

.calendar-day .day-item {
  font-size: 0.7rem;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.calendar-day .day-capacity {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 0.3rem;
  padding: 0.15rem 0.3rem;
  border-radius: 25px;
  display: inline-block;
}

.day-capacity.available {
  background: var(--green-light);
  color: var(--green);
}

.day-capacity.low {
  background: #FFF3E0;
  color: #E65100;
}

.day-capacity.sold-out {
  background: var(--red-light);
  color: var(--red);
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(51, 51, 51, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 1.5rem;
}

/* ---- Menu Items in Modal ---- */
.menu-item-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.menu-item-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.birthday-item-img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  float: right;
  margin-left: 0.75rem;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.menu-item-card .item-info h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: var(--text-dark);
}

.menu-item-card .item-info p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.menu-item-card .item-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  white-space: nowrap;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quantity-control button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.quantity-control button:hover {
  background: var(--primary);
  color: var(--white);
}

.quantity-control .qty-display {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 2rem;
  text-align: center;
}

.quantity-control label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ---- Birthday Cookie Section ---- */
.birthday-section {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--white);
}

.birthday-section h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.birthday-section p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.birthday-section .quantity-control button {
  border-color: var(--white);
  color: var(--white);
  background: transparent;
}

.birthday-section .quantity-control button:hover {
  background: var(--white);
  color: var(--primary);
}

.birthday-section .quantity-control .qty-display {
  color: var(--white);
}

.birthday-section .quantity-control label {
  color: rgba(255, 255, 255, 0.9);
}

.birthday-name-input {
  margin-top: 0.5rem;
}

.birthday-name-input label {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--white);
}

.birthday-name-input input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--white);
}

.birthday-name-input input:focus {
  outline: none;
  border-color: var(--white);
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

/* ---- Order Summary ---- */
.order-summary {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.order-summary h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.order-summary .summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

.order-summary .summary-total {
  border-top: 2px solid var(--primary);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

/* ---- Alerts ---- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: var(--green-light);
  color: #2E7D2E;
  border: 1px solid #C8E6C9;
}

.alert-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #FFCDD2;
}

.alert-info {
  background: rgba(199, 125, 255, 0.1);
  color: var(--primary);
  border: 1px solid var(--accent-light);
  border-left: 4px solid var(--accent);
}

/* ---- Success Screen ---- */
.success-screen {
  text-align: center;
  padding: 2rem 1rem;
}

.success-screen .checkmark {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--green);
}

.success-screen h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--green);
}

.success-screen p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ---- Loading ---- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-light);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

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

/* ---- Sold Out Overlay ---- */
.sold-out-badge {
  background: var(--red);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */

/* ---- Admin Login ---- */
.admin-login {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-login h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

/* ---- Admin Tabs ---- */
.admin-tabs {
  display: flex;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.admin-tab {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  background: var(--bg-light);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.admin-tab:hover {
  background: var(--white);
}

.admin-tab.active {
  background: var(--white);
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ---- Admin Cards ---- */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.admin-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* ---- Menu Item List (Admin) ---- */
.admin-item-list {
  list-style: none;
}

.admin-item-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-item-list li:last-child {
  border-bottom: none;
}

.admin-item-list .item-detail {
  flex: 1;
}

.admin-item-list .item-detail .item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.admin-item-list .item-detail .item-desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

.admin-item-list .item-detail .item-meta {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.admin-item-list .item-actions {
  display: flex;
  gap: 0.3rem;
}

/* ---- Admin Calendar ---- */
.admin-calendar-day {
  min-height: 80px;
  cursor: pointer;
}

.admin-calendar-day:hover:not(.past):not(.empty) {
  border-color: var(--secondary);
}

.admin-calendar-day .assigned-items {
  font-size: 0.65rem;
  color: var(--primary);
}

/* ---- Orders Table ---- */
.orders-filter {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.order-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.3s;
}

.order-card:hover {
  box-shadow: var(--shadow);
}

.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.order-card .order-customer {
  font-weight: 700;
  font-size: 1rem;
}

.order-card .order-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

.order-card .order-items {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.order-card .order-contact {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: #FFF3E0;
  color: #E65100;
}

.status-confirmed {
  background: rgba(199, 125, 255, 0.15);
  color: var(--primary);
}

.status-completed {
  background: var(--green-light);
  color: var(--green);
}

.status-paid {
  background: var(--green-light);
  color: var(--green);
  margin-right: 0.4rem;
}

/* ---- Admin Day Edit Modal ---- */
.day-edit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.day-edit-item .item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---- Bulk Assign ---- */
.bulk-assign {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.bulk-assign h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ---- Admin Header ---- */
.admin-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.admin-header .user-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ---- No Items Message ---- */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---- Payment Methods (confirmation screen) ---- */
.payment-methods {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.payment-methods h4 {
  font-family: 'Playfair Display', serif;
  color: var(--primary);
}

.payment-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.payment-qr {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  padding: 4px;
}

.payment-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.payment-handle {
  font-size: 0.8rem;
  color: var(--text-light);
}

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

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.6rem;
  }

  .calendar-grid .day-label {
    font-size: 0.65rem;
  }

  .calendar-day {
    min-height: 70px;
    padding: 0.3rem;
  }

  .calendar-day .day-number {
    font-size: 0.8rem;
  }

  .calendar-day .day-item {
    font-size: 0.6rem;
  }

  .calendar-day .day-capacity {
    font-size: 0.55rem;
  }

  .modal {
    max-height: 100vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    font-size: 0.8rem;
  }

  .admin-tab {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }

  .orders-filter {
    flex-direction: column;
  }

  .menu-item-img {
    width: 70px;
    height: 70px;
  }

  .birthday-item-img {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .calendar-grid .day-label {
    font-size: 0.55rem;
    letter-spacing: 0;
  }

  .calendar-day {
    min-height: 60px;
  }

  .calendar-day .day-item {
    display: none;
  }

  .birthday-banner {
    font-size: 0.8rem;
  }
}
