/* CSS Styles for MJ Interactive Board */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@0,400;0,900;1,400;1,900&family=Noto+Serif+Display:wdth,wght@62.5,300..900&display=swap');

.mj-board-wrap {
  position: relative;
  width: 100% !important;
  min-height: 600px;
  border-radius: 0px;
  overflow: hidden;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  background-color: #194099;
  --tone: dark;
}

/* Backgrounds */
.mj-board-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Fabric theme */
.mj-board-bg.mj-bg-fabric {
  background-color: #194099; 
  background-image: 
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.38) 100%),
    url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 0h1v4H1zm2 0h1v4H3zM0 1h4v1H0zm0 2h4v1H0z' fill='rgba(255,255,255,0.05)'/%3E%3Cpath d='M0 0h1v1H0zm2 2h1v1H2z' fill='rgba(0,0,0,0.08)'/%3E%3C/svg%3E");
  background-size: auto, 4px 4px;
}

/* Cork theme */
.mj-board-bg.mj-bg-cork {
  background-color: #d2a679;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.25) 100%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cork'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' result='noise'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.8 0 0 0 0 0.65 0 0 0 0 0.5 0 0 0 0.15 0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(https://www.maisonjurio.com/wp-content/plugins/mj-interactive-board/assets/css/)'/%3E%3C/svg%3E");
}

/* Photographic Grain Overlay */
.mj-board-grain-engine {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: overlay;
  opacity: 0.85; 
}

/* Board canvas */
.mj-board {
  position: relative;
  width: 100%;
  min-height: 1050px;
  z-index: 5;
  padding: 120px 30px 30px 30px;
  box-sizing: border-box;
}

/* Note Wrapper: base wrapper for cards */
.mj-note-wrapper {
  position: absolute;
  cursor: grab;
  user-select: none;
  z-index: 10;
  will-change: left, top;
}

.mj-note-wrapper:active {
  cursor: grabbing;
}

/* Polaroid dimensions */
.mj-note-wrapper.mj-type-polaroid {
  width: 190px !important;
  height: auto !important;
  min-height: 220px !important;
}

/* Large Polaroid style dimension */
.mj-note-wrapper.mj-type-polaroid-large {
  width: 460px !important;
  height: auto !important;
  min-height: 460px !important;
}

/* Standard Sticky Note dimensions */
.mj-note-wrapper.mj-type-sticky {
  width: 180px !important;
  height: auto !important;
  min-height: 180px !important;
}

/* A4 letter size dimension */
.mj-note-wrapper.mj-type-a4 {
  width: 450px !important;
  height: auto !important;
  min-height: 630px !important;
}

/* Polaroid card paper look */
.mj-type-polaroid .mj-note-paper,
.mj-type-polaroid-large .mj-note-paper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
  border-radius: 2px;
  background-color: #faf8f2;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(0,0,0,0.03) 100%);
  z-index: 12; 
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.06);
}

.mj-type-polaroid .mj-note-paper {
  padding: 10px 10px 30px 10px;
  min-height: 220px !important;
}

.mj-type-polaroid-large .mj-note-paper {
  padding: 20px 20px 40px 20px;
  min-height: 460px !important;
}

.mj-note-img {
  object-fit: cover !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  border-radius: 1px !important;
  pointer-events: none !important;
  display: block !important;
}

.mj-type-polaroid .mj-note-img {
  width: 170px !important;
  height: 150px !important;
  max-width: 170px !important;
  max-height: 150px !important;
  margin-bottom: 8px !important;
}

.mj-type-polaroid-large .mj-note-img {
  width: 420px !important;
  height: 360px !important;
  max-width: 420px !important;
  max-height: 360px !important;
  margin-bottom: 15px !important;
}

.mj-type-polaroid .mj-note-text,
.mj-type-polaroid-large .mj-note-text {
  width: 100%;
  text-align: center;
  color: rgba(18, 12, 5, 0.85);
  font-family: 'Instrument Serif', 'Noto Serif Display', serif;
  white-space: normal;
  overflow: visible;
  line-height: 1.15;
}

.mj-type-polaroid .mj-note-text {
  font-weight: 700;
  font-size: 18px;
}

.mj-type-polaroid-large .mj-note-text {
  font-weight: 400;
  font-size: 18px;
  font-style: italic;
  color: rgba(18, 12, 5, 0.7);
  line-height: 1.2;
}

/* Classic Sticky Note Paper look */
.mj-type-sticky .mj-note-paper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 180px !important;
  padding: 24px 16px 14px;
  box-sizing: border-box;
  border-radius: 2px;
  background-image: linear-gradient(225deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.12) 40%, rgba(0,0,0,0.08) 100%);
  z-index: 12; 
  display: flex;
  align-items: center;
  justify-content: center;
}

.mj-type-sticky .mj-note-text {
  outline: none;
  width: 100%;
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(18, 12, 5, 0.85);
  font-weight: 600;
  font-size: 18px;
  font-family: 'Instrument Serif', 'Noto Serif Display', serif;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  overflow: visible !important;
  line-height: 1.35;
}

/* Premium A4 Paper Sheet look */
.mj-type-a4 .mj-note-paper {
  position: relative;
  width: 100%;
  min-height: 630px;
  padding: 55px 45px;
  box-sizing: border-box;
  border-radius: 1px;
  background-color: #fafaf8;
  background-image: linear-gradient(225deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.1) 40%, rgba(0,0,0,0.04) 100%);
  border: 1px solid rgba(0,0,0,0.08);
  z-index: 12; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.01);
}

.mj-type-a4 .mj-note-text {
  outline: none;
  color: rgba(24, 20, 16, 0.88);
  font-size: 16px;
  font-family: 'Instrument Serif', 'Noto Serif Display', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: normal;
  overflow: visible;
  line-height: 1.5;
  text-align: justify;
}

.mj-type-a4 .mj-note-text p {
  margin: 0 0 20px 0;
}

.mj-type-a4 .mj-note-text p:last-child {
  margin-bottom: 0;
}

.mj-letter-signature {
  margin-top: 25px;
  text-align: right;
}
.mj-letter-signature img {
  max-height: 50px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}

/* Bulgarian Language Overrides */
:lang(bg) .mj-note-text {
  font-family: 'Noto Serif Display', serif;
}
:lang(bg) .mj-type-polaroid .mj-note-text {
  font-weight: 500 !important;
}
:lang(bg) .mj-type-sticky .mj-note-text {
  font-weight: 400 !important;
}
:lang(bg) .mj-type-a4 .mj-note-text {
  font-weight: 400 !important;
  line-height: 1.6;
}

/* Warped SVG Shadow Layer */
.mj-note-shadow-svg {
  position: absolute;
  top: -60px;
  left: -60px;
  width: calc(100% + 120px);
  height: calc(100% + 120px);
  pointer-events: none;
  z-index: 5;
  overflow: visible;
  will-change: transform;
}

.mj-shadow-path-sharp,
.mj-shadow-path-soft {
  transition: d 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Pins Layer */
.mj-pins-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20; 
}

/* Tack/Pin */
.mj-note-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #444444 0%, #151515 45%, #000000 85%);
  box-shadow: 
    -1.5px 2.5px 3.5px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.mj-note-pin-shadow {
  position: absolute;
  top: 6px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  filter: blur(1.5px);
  z-index: -1;
}

/* Pastels / Sticky backgrounds */
.color-yellow { --mj-note-bg: #F3CE63; }
.color-pink   { --mj-note-bg: #f8c2ca; }
.color-blue   { --mj-note-bg: #b9e0f3; }
.color-green  { --mj-note-bg: #b7e8c3; }
.color-orange { --mj-note-bg: #ffd1ad; }
.color-white  { --mj-note-bg: #faf8f2; }

.mj-type-sticky.color-yellow { --mj-note-bg: #F3CE63; }
.mj-type-sticky.color-pink   { --mj-note-bg: #f8c2ca; }
.mj-type-sticky.color-blue   { --mj-note-bg: #b9e0f3; }
.mj-type-sticky.color-green  { --mj-note-bg: #b7e8c3; }
.mj-type-sticky.color-orange { --mj-note-bg: #ffd1ad; }
.mj-type-sticky.color-white  { --mj-note-bg: #faf8f2; }

.mj-type-sticky .mj-note-paper {
  background-color: var(--mj-note-bg);
}

/* Entry Animations */
.mj-note-paper,
.mj-note-shadow-svg {
  animation: mj-card-put 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}
.mj-note-pin {
  animation: mj-pin-put 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

@keyframes mj-card-put {
  0% {
    opacity: 0;
    transform: translateY(-40px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mj-pin-put {
  0% {
    opacity: 0;
    transform: translate(-50%, -90px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Layout Concentration widths */
@media (min-width: 950px) {
  .mj-board {
    padding-left: 10% !important;
    padding-right: 10% !important;
  }
}
@media (min-width: 1300px) {
  .mj-board {
    padding-left: 16% !important;
    padding-right: 16% !important;
  }
}

/* Responsive Scaling for Mobile Screens */
@media (max-width: 768px) {
  .mj-board {
    padding-top: 180px !important;
  }
  .mj-note-wrapper.mj-type-polaroid-large {
    width: 320px !important;
    height: auto !important;
    min-height: 320px !important;
  }
  .mj-type-polaroid-large .mj-note-paper {
    min-height: 320px !important;
  }
  .mj-note-wrapper.mj-type-a4 {
    width: 320px !important;
    height: auto !important;
    min-height: 480px !important;
  }
  .mj-type-polaroid-large .mj-note-img {
    width: 280px !important;
    height: 230px !important;
    max-width: 280px !important;
    max-height: 230px !important;
  }
  .mj-type-a4 .mj-note-paper {
    min-height: 480px;
    padding: 30px 25px;
  }
  .mj-type-a4 .mj-note-text {
    font-size: 15px;
    line-height: 1.45;
  }
  .mj-letter-signature {
    margin-top: 15px;
  }
  .mj-letter-signature img {
    max-height: 38px;
  }
}

@media (max-width: 480px) {
  .mj-board {
    padding-top: 180px !important;
  }
}
