/* Global styles */
html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  background-color: #fff;
  color: #333;
  line-height: 1.5;
  direction: rtl;
}

/* Custom font for engraving text. The Harir font is loaded from the local assets
 * directory and used for the debossed engraving preview. This must remain in
 * sync with the font files placed in frontend/assets/. */
@font-face {
  font-family: "Harir";
  src: url("./assets/harir_Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

#engraving-text {
  font-family: "Harir", sans-serif !important;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  font-weight: normal;
  letter-spacing: 0;
}

/* Default size = desktop */
#engraving-text {
  font-size: 28px;
}

/* Tablet */
@media (max-width: 1024px) {
  #engraving-text {
    font-size: 24px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  #engraving-text {
    font-size: 20px;
  }
}

/* Header */
.header {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-brand img.logo-normal {
  display: block;
  height: 30px;
}

/* Main content */
.main {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  width: 100%;
  max-width: 550px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px #f3efe9 solid
}

/* Image and engraving area */
.image-container {
  background-color: #f7f3ec;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.image-wrapper {
  position: relative;
  width: 100%;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.engraving-overlay {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.engraving-overlay span {
  display: inline-block;
  /* Use the Harir font for engraving. Fall back to Lateef and generic serif if unavailable */
  font-family: 'Harir', 'Lateef', serif;
  /* Default font size will be overridden dynamically to fit the engraving box */
  font-size: 2rem;
  color: #3f3016;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7), 0 -1px 1px rgba(0, 0, 0, 0.5);
}

/* Back/close button area */
.button-container {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}

.back-button {
  display: inline-block;
  background-color: #0f0e0e;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.back-button:hover {
  background-color: #b7975e;
}

/* Preview note styling */
.preview-note {
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  color: #524f4b;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
  opacity: 0.85;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .card {
    border-radius: 12px;
  }
}