/* VIPCall style.css — Premium Utilitarian Minimalism */
/* ponytail: custom color palette, use CSS variables if dynamic theme switching is needed later */

/* Reset & Base Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Switzer", sans-serif;
  color: #2f3437; /* Charcoal black */
  background-color: #f5e4d7; /* Warm cream background */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 64px; /* Space for fixed navbar */
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid #bdbbb6;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 900;
}

.navbar-content {
  width: 100%;
  max-width: 1440px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-sub {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #787774;
  background-color: #f7f6f3;
  padding: 2px 8px;
  border-radius: 4px;
}

.brand-sub.env-preview {
  color: #b45309;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
}

.brand-sub.env-development {
  color: #1d4ed8;
  background-color: #dbeafe;
  border: 1px solid #bfdbfe;
}

.nav-account-btn {
  background: none;
  border: none;
  color: #2f3437;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.nav-account-btn:hover {
  background-color: rgba(115, 135, 123, 0.12);
  color: #73877b;
}

.account-icon {
  width: 24px;
  height: 24px;
}

/* Backdrop Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(1px);
  z-index: 950;
  transition: opacity 0.3s ease;
}

/* App Container Layout */
.app-container {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 64px);
  width: 100%;
}

/* Left Panel: Catalog List */
.panel-left {
  width: 100%;
  max-width: 1200px; /* Expanded for grid layout */
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.catalog-header {
  width: 100%;
  max-width: 1000px; /* Matches product-list max-width for perfect alignment */
}

/* Right Panel: Sticky Form Column (Drawer Style) */
.panel-right {
  width: 460px;
  background-color: #ffffff;
  border-left: 1px solid #bdbbb6;
  padding: 64px 48px;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.admin-drawer-open .panel-right {
  transform: translateX(0);
}

/* Close Drawer Button */
.btn-close-drawer {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #787774;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.btn-close-drawer:hover {
  background-color: #f7f6f3;
  color: #111111;
}

.close-icon {
  width: 18px;
  height: 18px;
}

/* Typography & Headings */
.brand-meta {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #787774; /* Muted gray */
  margin-bottom: 8px;
}

.catalog-title {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #111111;
  margin-bottom: 24px;
}

.form-title {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #111111;
  margin-bottom: 8px;
}

.form-subtitle {
  font-size: 14px;
  color: #787774;
  margin-bottom: 32px;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid #bdbbb6;
  padding-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: #787774;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  outline: none;
}

.tab-btn.active {
  background-color: #73877b;
  color: #ffffff;
}

.tab-btn:not(.active):hover {
  background-color: rgba(115, 135, 123, 0.12);
  color: #73877b;
}

/* Search Bar styling */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-bottom: 48px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #787774;
  pointer-events: none;
}

#catalog-search {
  width: 100%;
  padding: 12px 16px 12px 48px;
  font-size: 14px;
  color: #2f3437;
  background-color: #ffffff;
  border: 1px solid #bdbbb6;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease;
}

#catalog-search:focus {
  border-color: #73877b;
}

/* Form Styles */
.form-wrapper {
  width: 100%;
}

.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: #2f3437;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="password"],
textarea,
select {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid #bdbbb6;
  border-radius: 6px;
  outline: none;
  color: #2f3437;
  background-color: #ffffff;
  width: 100%;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #73877b;
}

/* Custom Select Dropdown Arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23787774' d='m128 180-80-80h160z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
  cursor: pointer;
}

/* Image Toggle Buttons */
.image-toggle-buttons {
  display: flex;
  border: 1px solid #bdbbb6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.toggle-btn {
  flex: 1;
  background: #ffffff;
  border: none;
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
  color: #787774;
  outline: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toggle-btn.active {
  background-color: rgba(115, 135, 123, 0.12);
  color: #73877b;
  font-weight: 600;
}

.toggle-btn:not(.active):hover {
  background-color: #fafafa;
  color: #2f3437;
}

/* Dropzone styling */
.file-dropzone {
  border: 1px dashed #bdbbb6;
  border-radius: 6px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.file-dropzone:hover {
  background-color: #ffffff;
  border-color: #73877b;
}

.file-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 24px;
  height: 24px;
  color: #787774;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 13px;
  color: #787774;
}

/* Preview Image styling & Cropper */
.image-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
  border: 1px solid #bdbbb6;
  border-radius: 8px;
  padding: 16px;
  background-color: #ffffff;
  width: 100%;
}

.crop-container {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  border: 1px solid #bdbbb6;
  border-radius: 6px;
  cursor: grab;
  background-color: #f7f6f3;
  user-select: none;
  touch-action: none;
}

.crop-container:active {
  cursor: grabbing;
}

#image-preview {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  user-select: none;
  pointer-events: auto;
  max-width: none;
  max-height: none;
}

.crop-controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.crop-zoom-label {
  font-size: 11px;
  font-weight: 600;
  color: #787774;
  margin-bottom: 0;
  text-transform: uppercase;
}

#crop-zoom {
  flex: 1;
  height: 4px;
  background: #bdbbb6;
  border-radius: 2px;
  appearance: none;
  outline: none;
  cursor: pointer;
}

#crop-zoom::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #73877b;
  border: 1px solid #bdbbb6;
  transition: background 0.15s ease;
}

#crop-zoom::-webkit-slider-thumb:hover {
  background: #5f7267;
}

.crop-instruction {
  font-size: 11px;
  color: #787774;
  margin-top: 8px;
  margin-bottom: 12px;
}

/* Error message styling */
.error-message {
  display: none;
  font-size: 11px;
  color: #9f2f2d;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select,
.form-group.has-error .file-dropzone {
  border-color: #9f2f2d;
}

.form-group.has-error .error-message {
  display: block;
}

.form-error {
  margin-bottom: 16px;
  text-align: center;
  display: none;
  background-color: #fdebec;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(159, 47, 45, 0.15);
}

/* Buttons */
.btn-primary {
  display: inline-block;
  width: 100%;
  background-color: #73877b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-top: 8px;
}

.form-actions-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.form-actions-row .btn-primary {
  margin-top: 0;
}

.form-actions-row .btn-secondary {
  width: 100%;
  padding: 14px 24px;
  font-size: 14px;
  text-align: center;
}

.btn-primary:hover {
  background-color: #5f7267;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-text-only {
  background: none;
  border: none;
  font-size: 12px;
  color: #787774;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.btn-text-only:hover {
  color: #9f2f2d;
}

/* Admin header controls inside panel */
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #bdbbb6;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.btn-logout-header {
  background: none;
  border: 1px solid #bdbbb6;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #787774;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout-header:hover {
  color: #9f2f2d;
  background-color: #fdebec;
  border-color: #9f2f2d;
}

/* Loading Spinner */
.auth-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 200px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #eaeaea;
  border-top-color: #111111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Product Cards rendering */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  width: 100%;
  max-width: 1000px;
}

.product-card {
  background-color: #ffffff;
  border: 1px solid #bdbbb6;
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.2s ease, transform 0.3s ease, opacity 0.3s ease;
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.product-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.03);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-title {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 500;
  color: #111111;
  line-height: 1.2;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-price {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", monospace;
  font-size: 15px;
  font-weight: 600;
  color: #111111;
}

.card-category {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
}

/* Category colors */
.card-category[data-cat="Indian"] {
  background-color: rgba(115, 135, 123, 0.12);
  color: #73877b;
}

.card-category[data-cat="Russian"] {
  background-color: rgba(229, 209, 208, 0.35);
  color: #856160;
}

.card-description {
  font-size: 13.5px;
  color: #787774;
  margin-bottom: 24px;
  line-height: 1.6;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.card-image-wrapper {
  width: 100%;
  height: 240px;
  flex-shrink: 0;
  border-bottom: 1px solid #bdbbb6;
  background-color: #f7f6f3;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .card-image {
  transform: scale(1.03);
}

/* Remove button in card - Hidden from public unless logged in */
.btn-delete-product {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 12px;
  color: #787774;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

body:not(.admin-logged-in) .btn-delete-product {
  display: none !important; /* Hide delete button for public guests */
}

.btn-delete-product:hover {
  color: #9f2f2d;
  background-color: #fdebec;
}

.delete-icon {
  width: 14px;
  height: 14px;
}

/* Edit button in card - Hidden from public unless logged in */
.btn-edit-product {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 12px;
  color: #787774;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

body:not(.admin-logged-in) .btn-edit-product {
  display: none !important; /* Hide edit button for public guests */
}

.btn-edit-product:hover {
  color: #73877b;
  background-color: rgba(115, 135, 123, 0.12);
}

.edit-icon {
  width: 14px;
  height: 14px;
}

/* WhatsApp Inquiry Button */
.btn-whatsapp-inquire {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bdbbb6;
  background-color: #ffffff;
  color: #2f3437;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-whatsapp-inquire:hover {
  background-color: rgba(115, 135, 123, 0.12);
  color: #73877b;
  border-color: #73877b;
}

.whatsapp-icon {
  width: 14px;
  height: 14px;
}

/* Empty State / Hidden utilities */
.empty-state {
  padding: 64px 32px;
  border: 1px dashed #eaeaea;
  border-radius: 8px;
  text-align: center;
  color: #787774;
  font-size: 14px;
  max-width: 1000px;
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card.fade-out {
  opacity: 0;
  transform: translateY(-12px);
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .panel-right {
    width: 380px;
    padding: 48px 32px;
  }
  .panel-left {
    padding: 48px 40px;
  }
}

@media (max-width: 768px) {
  .panel-left {
    padding: 32px 24px;
  }
  
  .panel-right {
    width: 100%;
    border-left: none;
    padding: 32px 24px;
  }
  
  .product-card {
    padding: 0;
  }
  
  .card-image-wrapper {
    height: 200px;
  }
}

/* Custom Confirmation Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* Above the admin drawer */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: #ffffff;
  border: 1px solid #bdbbb6;
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.modal-overlay:not(.hidden) .modal-card {
  transform: scale(1);
}

.modal-title {
  font-family: 'Playfair Display', 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 500;
  color: #111111;
  margin-bottom: 12px;
}

.modal-text {
  font-size: 14px;
  color: #787774;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  background-color: #f7f6f3;
  color: #2f3437;
  border: 1px solid #eaeaea;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: #eaeaea;
}

.btn-danger {
  background-color: #9f2f2d; /* Stark red */
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background-color: #832523;
}

/* Loading Skeleton */
.skeleton-card {
  background-color: #ffffff;
  border: 1px solid #bdbbb6;
  border-radius: 8px;
  overflow: hidden;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.skeleton-image {
  width: 100%;
  height: 240px;
  background: linear-gradient(90deg, #eaeaea 25%, #f2f2f2 50%, #eaeaea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, #eaeaea 25%, #f2f2f2 50%, #eaeaea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-title {
  width: 70%;
  height: 20px;
}

.skeleton-meta {
  width: 40%;
}

.skeleton-desc {
  width: 100%;
  height: 48px;
}

.skeleton-footer {
  margin-top: auto;
  width: 30%;
  height: 32px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

  .navbar {
    height: 56px;
  }

  .navbar-content {
    padding: 0 16px;
  }

  .panel-left {
    padding: 24px 16px;
  }

  .catalog-title {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .filter-tabs {
    margin-bottom: 24px;
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-wrapper {
    margin-bottom: 32px;
  }

  .product-list {
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .panel-right {
    width: 100%;
    max-width: 100%;
    padding: 48px 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .product-list {
    grid-template-columns: 1fr;
  }
  
  .crop-container {
    height: 180px;
  }
}
