/* --------------------------------------------------
   LOCAL FONTS
-------------------------------------------------- */
@font-face {
  font-family: Inter;
  src: url("/assets/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* --------------------------------------------------
   CAMERA GEOMETRY — JS-SIZED, CSS-LAID-OUT
   Matches layout.ts:
     CAM-PORTRAIT
     CAM-LANDSCAPE-A
     CAM-LANDSCAPE-B
-------------------------------------------------- */

#b-camera {
  position: absolute;
  inset: 0;
  margin: auto;
  container-type: size;
  overflow: hidden;
  background: var(--back);
}

/* --------------------------------------------------
   CAMERA INTERNAL AREAS
-------------------------------------------------- */

#b-camera-style {
  display: grid;
  height: 100%;
  width: 100%;
  grid-template-areas:
    "header"
    "client"
    "footer";
}

#b-top-bar {
  grid-area: header;
  overflow: hidden;
  container-type: size;
  width: 100%;
}

#b-client-area {
  grid-area: client;
}

#b-bottom-bar {
  grid-area: footer;
  overflow: hidden;
}

/* --------------------------------------------------
   PORTRAIT MODE
   JS sets width/height; CSS sets layout only
-------------------------------------------------- */

.CAM-PORTRAIT#b-camera-style {
  grid-template-rows: 20% auto 5%
}

/* --------------------------------------------------
   LANDSCAPE-A MODE
   JS sets width/height; CSS sets layout only
-------------------------------------------------- */

.CAM-LANDSCAPE-A#b-camera-style {
  grid-template-rows: 15% 80% 5%;
}

/* --------------------------------------------------
   LANDSCAPE-B MODE
   JS sets width/height; CSS sets layout only
-------------------------------------------------- */

.CAM-LANDSCAPE-B#b-camera-style {
  grid-template-rows: 15% 80% 5%;
}

/* --------------------------------------------------
   GLOBAL THEME VARIABLES
-------------------------------------------------- */
:root[data-theme="light"] {
  --back: #f7f7f7;
  --panel: #ffffff;
  --button: #f0f0f0;
  --text: #222222;
  --line: #9c9c9c;
  --highlight1: #4aa3ff;
  --highlight2: #ffd84a;
  --logo-bg: #e0e0e0;
  --logo-fg: #222;
  --logo-shadow: 0 2px 4px rgb(0 0 0 0.15);
}

:root[data-theme="dark"] {
  --back: #111111;
  --panel: #1b1b1b;
  --button: #4a4a4a;
  --text: #eeeeee;
  --line: #848484;
  --highlight1: #4aa3ff;
  --highlight2: #ffd84a;
  --logo-bg: #333;
  --logo-fg: #eee;
  --logo-shadow: 0 2px 4px rgb(0 0 0 0.4);
}

/* --------------------------------------------------
   GLOBAL BODY
-------------------------------------------------- */
html {
  margin: 0;
  padding: 0;
  height:100%;
  width:100%;
}

body { 
  background: var(--back);
  margin: 0;
  padding: 0; 
  height: 100%;
  width: 100%;
}

html, body, button, input, select, textarea {
    font-family: Inter, sans-serif;
    font-size: var(--std-font-size);
    color: var(--text);
}

button {
  background: var(--button);
}

/* --------------------------------------------------
   MODAL SYSTEM
-------------------------------------------------- */

#b-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

#b-modal-root .buldng-modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--modal-backdrop-color, rgba(0, 0, 0, 0.5));
  pointer-events: auto;
}
#b-modal-root .buldng-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  max-height: min(100%, 720px);
  overflow: auto;
  color: var(--text, #222222);
  background: var(--modal-bg, var(--panel, #ffffff));
  border: 2px solid var(--modal-accent-color, #0066cc);
  border-radius: var(--modal-radius, 12px);
  box-shadow: var(--modal-shadow, 0 4px 20px rgba(0, 0, 0, 0.3));
}

#b-modal-root .buldng-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--modal-padding, 20px) var(--modal-padding, 20px) 0;
}

#b-modal-root .buldng-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  color: var(--modal-accent-color, #0066cc);
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 50%;
}

#b-modal-root .buldng-modal-title {
  margin: 0;
  color: inherit;
  font-size: 1.2em;
}

#b-modal-root .buldng-modal-content {
  padding: var(--modal-padding, 20px);
  overflow: auto;
}

#b-modal-root .buldng-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 var(--modal-padding, 20px) var(--modal-padding, 20px);
}

#b-modal-root .buldng-modal-button {
  min-width: 88px;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--text, #222222);
  font: inherit;
  font-weight: 600;
  background: var(--button, #f0f0f0);
  border: 1px solid var(--line, #9c9c9c);
  border-radius: 4px;
  cursor: pointer;
}

#b-modal-root .buldng-modal-button-primary {
  color: #ffffff;
  background: var(--modal-accent-color, #0066cc);
  border-color: var(--modal-accent-color, #0066cc);
}

#b-modal-root .buldng-modal-button:focus-visible {
  outline: 3px solid var(--highlight1, #4aa3ff);
  outline-offset: 2px;
}

#b-modal-root .buldng-modal.info {
  --modal-accent-color: #0066cc;
}

#b-modal-root .buldng-modal.confirmation {
  --modal-accent-color: #444444;
}

#b-modal-root .buldng-modal.destructive,
#b-modal-root .buldng-modal.error {
  --modal-accent-color: #cc0000;
}

@media (max-width: 520px) {
  #b-modal-root .buldng-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  #b-modal-root .buldng-modal {
    width: 100%;
    max-height: 90%;
    border-radius: var(--modal-radius, 12px) var(--modal-radius, 12px) 0 0;
  }

  #b-modal-root .buldng-modal-footer {
    flex-direction: column-reverse;
  }

  #b-modal-root .buldng-modal-button {
    width: 100%;
  }
}

