/* ══════════════════════════════════════════
   COMPONENTS.CSS — Atoms & Shared Components
   ══════════════════════════════════════════ */

/* ── DIVIDERS & SECTIONS ── */
.sec         { padding: 14px 14px 0; }
.sec-label   { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--t0); margin-bottom: 8px; }
hr.rule      { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ── ROW — base unit ── */
.row               { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row:last-child    { border-bottom: none; }
.row-icon          { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.row-body          { flex: 1; min-width: 0; }
.row-body h4       { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-body p        { font-size: 12px; color: var(--t1); margin-top: 1px; }
.row-right         { font-size: 12px; color: var(--t1); white-space: nowrap; flex-shrink: 0; }
.row-right.accent  { color: var(--cy); }

/* ── BLOCKS ── */
.block        { background: var(--s1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.block + .block { border-top: none; }
.block-gap    { height: 20px; }

/* ── STAT GRID ── */
.stat-grid            { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin: 0; }
.stat-cell            { background: var(--s1); padding: 12px 14px; }
.stat-cell .val       { font-size: 22px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-cell .lbl       { font-size: 12px; color: var(--t2); letter-spacing: 1px; text-transform: uppercase; margin-top: 3px; }
.stat-cell.accent .val { color: var(--cy); }
.stat-cell.warn .val   { color: var(--or); }
.stat-cell.pos .val    { color: var(--ye); }

/* ── HERO ── */
.hero      { padding: 18px 14px 14px; border-bottom: 1px solid var(--line); }
.hero h1   { font-size: 24px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
.hero h1 em { color: var(--cy); font-style: normal; }
.hero p    { font-size: 12px; color: var(--t1); margin-top: 4px; }

/* ── BUTTONS ── */
.btn          { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 3px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 9px 14px; transition: opacity .15s; }
.btn:active   { opacity: .7; }
.btn-cy       { background: var(--cy); color: #000; }
.btn-ye       { background: var(--ye); color: #000; }
.btn-ghost    { background: none; border: 1px solid var(--line2); color: var(--t1); }
.btn-danger   { background: #1a0000; border: 1px solid var(--re); color: var(--re); }
.btn-wa       { background: #128C7E; color: #fff; }
.btn-full     { width: 100%; }
.btn-row      { display: flex; gap: 8px; padding: 10px 14px; }

/* ── INPUT / FIELD ── */
.field                                { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.field label                          { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t1); }
.field input, .field select, .field textarea {
  background: none;
  border: none;
  outline: none;
  color: var(--t0);
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  resize: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--t2); }
.field select option  { background: var(--s2); }
.field.inline         { flex-direction: row; align-items: center; }
.field.inline label   { white-space: nowrap; margin-right: 8px; flex-shrink: 0; }
.field.inline input   { text-align: right; font-size: 20px; font-weight: 800; }

/* ── TAGS ── */
.tag      { display: inline-block; font-size: 12px; letter-spacing: .5px; padding: 1px 5px; border-radius: 2px; }
.tag-cy   { background: rgba(0,229,255,.1);  color: var(--cy); }
.tag-ye   { background: rgba(255,230,0,.1);  color: var(--ye); }
.tag-re   { background: rgba(255,23,68,.1);  color: var(--re); }
.tag-or   { background: rgba(255,98,0,.1);   color: var(--or); }
.tag-gr   { background: rgba(57,255,20,.1);  color: var(--gr); }

/* ── TABS ── */
.tabs       { display: flex; border-bottom: 1px solid var(--line); }
.tab-btn    { flex: 1; padding: 9px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; text-align: center; cursor: pointer; color: var(--t2); border: none; background: none; border-bottom: 2px solid transparent; transition: all .15s; }
.tab-btn.on { color: var(--cy); border-bottom-color: var(--cy); }

.chk-row              { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chk-box              { width: 16px; height: 16px; border: 1.5px solid var(--line2); border-radius: 2px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.chk-row.done .chk-box  { background: var(--cy); border-color: var(--cy); }
.chk-row.done .chk-name { text-decoration: line-through; color: var(--t2); }
.chk-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-sub  { font-size: 12px; color: var(--t0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-del  { background: none; border: none; color: var(--t2); cursor: pointer; font-size: 12px; padding: 6px 8px; transition: color .15s; display: flex; align-items: center; justify-content: center; }
.chk-del:hover { color: var(--re); }

/* ── PROGRESS ── */
.prog-wrap  { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prog-bar   { height: 2px; background: var(--s3); margin-top: 6px; border-radius: 1px; }
.prog-fill  { height: 100%; background: var(--cy); border-radius: 1px; transition: width .3s; }

/* ── CATEGORY SCROLL ── */
.cat-scroll               { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line) transparent; -webkit-overflow-scrolling: touch; }
.cat-scroll::-webkit-scrollbar { height: 2px; }
.cat-scroll::-webkit-scrollbar-thumb { background: var(--line); }
.cat-item                 { flex-shrink: 0; padding: 8px 14px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--t1); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.cat-item.on              { color: var(--ye); border-bottom-color: var(--ye); }

/* ── CATEGORY CHIPS ── */
.cat-chips   { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); margin: 0; }
.cat-chip    { padding: 7px 12px; font-size: 12px; background: var(--s2); cursor: pointer; color: var(--t1); }
.cat-chip.on { background: rgba(0,229,255,.08); color: var(--cy); }

/* ── VOTE BUTTONS ── */
.vote-row { display: flex; gap: 4px; }
.vb       { background: none; border: 1px solid var(--line2); border-radius: 2px; padding: 2px 7px; font-size: 11px; color: var(--t1); cursor: pointer; }
.vb:hover { border-color: var(--cy); color: var(--cy); }

/* ── MODAL ── */
#rmodal        { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 50; display: none; align-items: flex-end; }
#rmodal.on     { display: flex; }
.rsheet        { background: var(--s1); border-top: 1px solid var(--line); width: 100%; padding: 14px; max-height: 75vh; overflow-y: auto; }
.rsheet h3     { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--t1); margin-bottom: 12px; }
.rtypes        { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); margin-bottom: 1px; }
.rtype         { background: var(--s2); padding: 10px 6px; text-align: center; cursor: pointer; transition: background .15s; }
.rtype.on      { background: rgba(0,229,255,.07); }
.rtype .ri     { font-size: 18px; display: block; margin-bottom: 3px; }
.rtype span    { font-size: 12px; color: var(--t1); letter-spacing: .3px; }

/* ── TOAST ── */
#toast     { position: fixed; bottom: 66px; left: 50%; transform: translateX(-50%) translateY(6px); background: var(--s2); border: 1px solid var(--line2); border-radius: 3px; padding: 6px 12px; font-size: 12px; letter-spacing: .3px; opacity: 0; transition: all .2s; z-index: 99; white-space: nowrap; pointer-events: none; }
#toast.on  { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MAP CATEGORY FILTER BAR ── */
.map-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  background: var(--s1);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
.map-filter-bar::-webkit-scrollbar {
  display: none; /* Safari / Chrome */
}
.map-filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 16px;
  background: var(--s2);
  border: 1px solid var(--line2);
  color: var(--t1);
  cursor: pointer;
  transition: all 0.15s ease;
}
.map-filter-chip:active {
  transform: scale(0.95);
}
.map-filter-chip.active {
  background: var(--ye);
  border-color: var(--ye);
  color: #000;
}

/* ── ROUTE PHOTO SHARE MODAL ── */
.photo-share-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}

.photo-share-backdrop {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.photo-share-container {
  background: var(--s1);
  border: 1px solid var(--line2);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
}

.photo-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--s2);
}

.photo-share-title h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--t0);
  margin: 2px 0 0;
}

.photo-share-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ye);
  text-transform: uppercase;
}

.photo-share-close-btn {
  background: none;
  border: none;
  color: var(--t1);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.photo-share-close-btn:hover {
  color: var(--t0);
  background: var(--s3);
}

.photo-share-preview-wrapper {
  position: relative;
  background-color: #080a0e;
  background-image: 
    linear-gradient(45deg, #12151c 25%, transparent 25%), 
    linear-gradient(-45deg, #12151c 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #12151c 75%), 
    linear-gradient(-45deg, transparent 75%, #12151c 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.photo-share-container.immersive-editor {
  max-width: 520px;
  height: 94vh;
  max-height: 94vh;
}

.photo-share-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
  cursor: grab;
  touch-action: none;
}

.photo-share-canvas:active {
  cursor: grabbing;
}

.photo-share-drag-hint {
  position: absolute;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 4px 12px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}

.photo-share-drag-hint span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

/* ── TOOL SHELF & TOOLBAR (MODO INMERSIVO) ── */
.photo-share-shelf {
  background: var(--s2);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.photo-share-shelf-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  padding: 2px 0;
}
.photo-share-shelf-content::-webkit-scrollbar { display: none; }

.photo-share-toolbar {
  display: flex;
  background: var(--s1);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  gap: 4px;
  justify-content: space-around;
  align-items: center;
}

.ps-tool-tab {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--t2);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-tool-tab:hover {
  color: var(--t0);
  background: var(--s2);
}
.ps-tool-tab.active {
  color: var(--ye);
  background: rgba(255, 230, 0, 0.08);
  border-color: rgba(255, 230, 0, 0.3);
  font-weight: 700;
}
.ps-tool-icon {
  font-size: 15px;
  line-height: 1;
}
.ps-tool-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.photo-share-controls {
  display: none;
}

.photo-share-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}
.photo-share-chips::-webkit-scrollbar { display: none; }

.photo-share-chip {
  flex-shrink: 0;
  background: var(--s3);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.photo-share-chip:active {
  transform: scale(0.96);
}

.photo-share-chip.active {
  background: var(--ye);
  border-color: var(--ye);
  color: #000;
  font-weight: 800;
}

.photo-share-color-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.photo-share-color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.photo-share-color-dot:active {
  transform: scale(0.9);
}

.photo-share-color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
}

.photo-share-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--s2);
}

.photo-share-footer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.photo-share-btn-primary {
  flex: 1.2;
  background: var(--ye);
  color: #000;
  font-weight: 900;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.photo-share-btn-primary:active {
  opacity: 0.8;
}

.photo-share-btn-secondary {
  flex: 1;
  background: var(--s3);
  border: 1px solid var(--line2);
  color: var(--t0);
  font-weight: 700;
  font-size: 11px;
  border-radius: 6px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}

.photo-share-btn-secondary:active {
  border-color: var(--t0);
  color: var(--t0);
}

/* ── LOADING OVERLAY ── */
.photo-share-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  animation: fadeIn 0.2s ease-out;
}

.photo-share-loading-overlay span {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.photo-share-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid rgba(255, 230, 0, 0.2);
  border-top-color: var(--ye);
  border-radius: 50%;
  animation: ps-spin 0.8s linear infinite;
}

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



