/* =============================================================================
   style.css — banchero costa
============================================================================= */

/* =============================================================================
   INDEX.HTML & MARKET.HTML STYLES
============================================================================= */


    @media screen and (min-width: 1024px) {
      .segments-grid {
      zoom: 1.2;
      -moz-transform: scale(1.2);
      -moz-transform-origin: 0 0;
      }
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg: #ffffff; --bg2: #e6e6e6; --bg3: #131820;
      --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.12);
      --text: #000000; --muted: #000000; --muted2: #000000;
      --accent: #d52b1e; --up: #00bb45; --down: #ff0000;
      --up-bg: rgba(74,222,128,0.08); --down-bg: rgba(248,113,113,0.08);
      --font-display: 'Syne', sans-serif; --font-mono: 'DM Mono', monospace;
      --drawer-width: 280px;
    }
    html { background: var(--bg); }
    body { font-family: var(--font-display); background: var(--bg); color: var(--text); display: flex; min-height: 100vh; overflow-x: hidden; margin: 0; flex-direction: column; }
    body::before {
      content: ''; position: fixed; inset: 0;
      background-image: linear-gradient(rgba(200,240,74,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(200,240,74,0.02) 1px, transparent 1px);
      background-size: 60px 60px; pointer-events: none; z-index: 0;
    }
    .page { position: relative; z-index: 1; max-width: 100%; margin: 0; padding: 0 28px 0; }

    /* -----------------------------------------------------------------------
       HEADER
    ----------------------------------------------------------------------- */
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 28px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0;
      position: relative;
      z-index: 10;
    }
    .logo-block { display: flex; flex-direction: column; gap: 4px; }
    .logo-block a { display: block; line-height: 0; }
    .logo-block img {
      height: 60px;
      width: auto;
      max-width: 200px;
      display: block;
    }

    /* -----------------------------------------------------------------------
       HAMBURGER BUTTON
    ----------------------------------------------------------------------- */
    .menu-toggle {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 5px;
      width: 40px;
      height: 40px;
      cursor: pointer;
      background: none;
      border: none;
      padding: 4px;
      border-radius: 6px;
      transition: background 0.15s ease;
      flex-shrink: 0;
    }
    .menu-toggle:hover { background: rgba(0,0,0,0.06); }
    .menu-toggle span {
      display: block;
      width: 22px;
      height: 2px;
      background: #000;
      border-radius: 2px;
      transition: transform 0.25s ease, opacity 0.2s ease;
      transform-origin: center;
    }
    /* Animate to X when open */
    body.drawer-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.drawer-open .menu-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    body.drawer-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* -----------------------------------------------------------------------
       DRAWER OVERLAY
    ----------------------------------------------------------------------- */
    .drawer-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.25);
      z-index: 100;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    body.drawer-open .drawer-overlay {
      display: block;
      opacity: 1;
    }

    /* -----------------------------------------------------------------------
       DRAWER PANEL
    ----------------------------------------------------------------------- */
    .drawer {
      position: fixed;
      top: 0;
      right: 0;
      width: var(--drawer-width);
      height: 100%;
      background: #f9f9f9;
      border-left: 1px solid rgba(0,0,0,0.1);
      z-index: 200;
      transform: translateX(100%);
      transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    body.drawer-open .drawer {
      transform: translateX(0);
    }

    /* Drawer header */
    .drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 20px 16px;
      border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    .drawer-logo img {
      height: 60px;
      width: auto;
    }
    .drawer-close {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      background: none;
      border: none;
      border-radius: 6px;
      color: #555;
      font-size: 20px;
      transition: background 0.15s;
    }
    .drawer-close:hover { background: rgba(0,0,0,0.07); }

    /* Drawer body */
    .drawer-body {
      flex: 1;
      padding: 24px 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow-y: auto;
    }

    /* Drawer links */
    .drawer-link {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 13px 16px;
      border-radius: 8px;
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-decoration: none;
      color: #111;
      background: rgba(0,0,0,0.04);
      border: 1px solid transparent;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
      user-select: none;
    }
    .drawer-link:hover {
      background: #fff;
      border-color: rgba(0,0,0,0.12);
    }
    .drawer-link .drawer-link-icon {
      font-size: 16px;
      width: 20px;
      text-align: center;
      flex-shrink: 0;
    }

    /* Live badge inside drawer */
    .drawer-live {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 16px;
      border-radius: 8px;
      background: rgba(0,187,69,0.08);
      border: 1px solid rgba(0,187,69,0.15);
      margin-bottom: 4px;
    }

    .drawer-live-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--up);
      animation: pulse 1s ease-in-out infinite;
    }

    #drawer-live-label {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.08em;
      color: var(--up);
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    /* Logout link — red tint */
    .drawer-link.drawer-logout {
      color: #c0392b;
      background: rgba(213,43,30,0.05);
    }
    .drawer-link.drawer-logout:hover {
      background: rgba(213,43,30,0.12);
      border-color: rgba(213,43,30,0.2);
    }

    /* Drawer footer */
    .drawer-footer {
      padding: 20px;
      border-top: 1px solid rgba(0,0,0,0.08);
    }
    .drawer-footer-title {
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: #999;
      margin-bottom: 8px;
    }
    .drawer-footer-text {
      font-family: var(--font-mono);
      font-size: 11px;
      color: #777;
      line-height: 1.65;
    }
    .drawer-footer-text a {
      color: var(--accent);
      text-decoration: none;
    }

    /* -----------------------------------------------------------------------
       Unified button sizing (kept for backward compat — no longer in header)
    ----------------------------------------------------------------------- */
    .live-badge,
    .refresh-btn,
    .logout-btn { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; display: inline-flex; align-items: center; justify-content: center; height: 32px; width: 100px; padding: 0 12px; box-sizing: border-box; border-radius: 20px; border: 1px solid transparent; white-space: nowrap; transition: all 0.2s ease; }
    .live-badge { gap: 7px; background: rgba(0, 255, 94, 0.178); color: #00bb45; }
    .live-badge:hover  { background: #fff; border-color: rgba(0, 0, 0, 0.2); }
    .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 1s ease-in-out infinite; }
    .refresh-btn { color: #000; background: rgba(211, 211, 211, 0.192); cursor: pointer; }
    .refresh-btn:hover { background: #fff; border-color: rgba(0, 0, 0, 0.2); }
    .logout-btn { color: #000; background: rgba(211, 211, 211, 0.2); text-decoration: none; }
    .logout-btn:hover { background: #fff; border-color: rgba(0, 0, 0, 0.2); }

    /* -----------------------------------------------------------------------
       REST OF THE LAYOUT (MARKET DATA PAGE)
    ----------------------------------------------------------------------- */
    .segments-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
    .seg-panel { background: #f1f1f1; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; animation: fadeIn 0.6s ease both; }
    @keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
    .seg-panel:nth-child(1) { animation-delay:0s; }
    .seg-panel:nth-child(2) { animation-delay:0.06s; }
    .seg-panel:nth-child(3) { animation-delay:0.12s; }
    .seg-panel:nth-child(4) { animation-delay:0.18s; }
    .seg-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 9px; border-bottom: 1px solid var(--border); position: relative; }
    .seg-head::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
    .seg-panel:nth-child(1) .seg-head::before { background: #4ade80; }
    .seg-panel:nth-child(2) .seg-head::before { background: #60a5fa; }
    .seg-panel:nth-child(3) .seg-head::before { background: #f59e0b; }
    .seg-panel:nth-child(4) .seg-head::before { background: #c084fc; }
    .seg-title { font-size: 20px; font-weight: 1000; letter-spacing: 0.1em; color: #000000; }
    .seg-pct-badge { font-family: var(--font-mono); font-size: 18px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
    .seg-pct-badge.up { background: var(--up-bg); color: var(--up); }
    .seg-pct-badge.dn { background: var(--down-bg); color: var(--down); }
    .seg-pct-badge.flat { background: rgba(255,255,255,0.04); color: var(--muted2); }
    .seg-col-heads { display: grid; grid-template-columns: 1fr 80px 72px; padding: 6px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.015); }
    .seg-col-heads span { font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #000000; }
    .seg-col-heads span:not(:first-child) { text-align: right; }
    .seg-row { display: grid; grid-template-columns: 1fr 80px 72px; padding: 9px 14px; border-bottom: 1px solid var(--border); transition: background 0.12s; }
    .seg-row:last-child { border-bottom: none; }
    .seg-row:hover { background: rgba(255,255,255,0.025); }
    .seg-row-name { font-family: var(--font-display); font-size: 20px; font-weight: 1000; color: var(--text); align-self: center; text-transform: uppercase; }
    .seg-row-price { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text); text-align: right; align-self: center; letter-spacing: -0.01em; }
    .seg-row-change { font-family: var(--font-mono); font-size: 20px; font-weight: 600; text-align: right; align-self: center; }
    .seg-row-change.up { color: var(--up); }
    .seg-row-change.dn { color: var(--down); }
    .seg-row-change.flat { color: var(--muted2); }
    .seg-empty { padding: 28px 14px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 1.6; }
    .skel { display: inline-block; height: 11px; border-radius: 3px; background: linear-gradient(90deg, var(--bg3) 25%, rgba(255,255,255,0.05) 50%, var(--bg3) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; }
    @keyframes skel { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }
    
    .footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 0 28px 28px 28px; gap: 12px; }
    .footer-ts, 
    .footer-src { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.05em; line-height: 1.5; }
    .footer-src a, 
    .footer-src a:visited, 
    .footer-src a:active { color: inherit; text-decoration: none; }

    /* Mobile Professional Fix */
    @media (max-width: 600px) {
      .footer { flex-direction: column; text-align: center; padding: 0 20px 40px; gap: 8px; }      
      .footer-src { display: block; word-break: break-word; } }
    @media (max-width: 1000px) { 
      .segments-grid { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 520px) { 
      .segments-grid { grid-template-columns: 1fr; } .page { padding: 0 14px 60px; } }

    /* [ADDED] Baltic ticker */
    .baltic-ticker-wrap { overflow: hidden; background: #f1f1f1; border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08); position: relative; margin-bottom: 20px; }
    .baltic-ticker-wrap::before, .baltic-ticker-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none; }
    .baltic-ticker-wrap::before { left: 0; background: linear-gradient(90deg, #f1f1f1, transparent); }
    .baltic-ticker-wrap::after  { right: 0; background: linear-gradient(-90deg, #f1f1f1, transparent); }
    .baltic-ticker-track { display: flex; width: max-content; }
    .baltic-ticker-track:hover { animation-play-state: paused; }
    @keyframes balticScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
    .baltic-ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-right: 1px solid rgba(0,0,0,0.07); white-space: nowrap; }
    .baltic-spacer { display: inline-block; height: 1px; flex-shrink: 0; }
    .bt-name { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: #555; letter-spacing: 0.08em; }
    .bt-val  { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: #000; }
    .bt-chg  { font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 3px; }
    .bt-chg.up   { background: rgba(0,187,69,0.1);  color: var(--up); }
    .bt-chg.dn   { background: rgba(255,0,0,0.08);  color: var(--down); }
    .bt-chg.flat { color: #999; }
    /* [END ADDED] Baltic ticker */

    /* -----------------------------------------------------------------------
       DASHBOARD PAGE STYLES
    ----------------------------------------------------------------------- */
    body.dashboard-page { flex-direction: column; }

    .dashboard-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 60px 28px;
    }

    .dashboard-header {
      text-align: center;
      margin-bottom: 60px;
      animation: fadeIn 0.6s ease both;
    }

    .dashboard-header h1 {
      font-size: 48px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 12px;
      color: #000000;
    }

    .dashboard-header p {
      font-size: 18px;
      color: #555;
      font-family: var(--font-mono);
      letter-spacing: 0.02em;
    }

    .apps-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 28px;
      max-width: 1400px;
      width: 100%;
    }

    .app-card {
      display: flex;
      flex-direction: column;
      padding: 32px 28px;
      background: #f1f1f1;
      border: 1px solid rgba(0,0,0,0.08);
      border-radius: 12px;
      text-decoration: none;
      color: inherit;
      transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
      position: relative;
      overflow: hidden;
      animation: fadeIn 0.6s ease both;
    }

    .app-card:nth-child(1) { animation-delay: 0s; }
    .app-card:nth-child(2) { animation-delay: 0.1s; }
    .app-card:nth-child(3) { animation-delay: 0.2s; }

    .app-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
    }

    .app-card-market::before { background: #4ade80; }
    .app-card-private::before { background: #f50af5; }
    .app-card-bimco::before { background: #60a5fa; }
    .app-card-form::before { background: #f59e0b; }
    
    .app-card:hover {
      transform: translateY(-8px);
      border-color: rgba(0,0,0,0.15);
      box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    }

    .app-icon {
      font-size: 56px;
      margin-bottom: 20px;
      display: inline-block;
    }

    .app-card h3 {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 12px;
      color: #000000;
      letter-spacing: -0.01em;
    }

    .app-card p {
      font-family: var(--font-mono);
      font-size: 14px;
      line-height: 1.7;
      color: #666;
      margin-bottom: 24px;
      flex: 1;
    }

    .app-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      padding-top: 20px;
      border-top: 1px solid rgba(0,0,0,0.08);
    }

    .app-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 20px;
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .app-status.live {
      background: rgba(0,187,69,0.12);
      color: var(--up);
    }

    .app-status.live::before {
      content: '●';
      animation: pulse 1.5s ease-in-out infinite;
    }

    .app-status.external {
      background: rgba(250, 96, 237, 0.12);
      color: #f50af5;
    }

    .app-status.internal {
      background: rgba(96,165,250,0.12);
      color: #60a5fa;
    }

    .app-status.ready {
      background: rgba(245,158,11,0.12);
      color: #d97706;
    }

    /* Responsive dashboard */
    @media (max-width: 1024px) {
      .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
      }

      .dashboard-container {
        padding: 40px 20px;
      }

      .dashboard-header h1 {
        font-size: 36px;
      }
    }

    @media (max-width: 600px) {
      .apps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
      }

      .dashboard-container {
        padding: 30px 14px;
      }

      .dashboard-header {
        margin-bottom: 40px;
      }

      .dashboard-header h1 {
        font-size: 28px;
      }

      .dashboard-header p {
        font-size: 14px;
      }

      .app-card {
        padding: 24px 20px;
      }

      .app-card h3 {
        font-size: 20px;
      }
    }

    .dashboard-footer {
      padding: 0 28px 20px 28px;
      justify-content: center;
    }
  

/* =============================================================================
   LOGIN.HTML STYLES  (scoped under body.login-page)
============================================================================= */

  body.login-page * {
    box-sizing: border-box;
  }

  body.login-page {
    margin: 0;
    font-family: 'Syne', sans-serif;
    background: url('/img/bc-bg-login.jpg') no-repeat center center fixed;
    background-size: cover;
    background-color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
  }

  .login-container {
    width: 100%;
    max-width: 380px;
    padding: 40px 30px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: #f9f9f9cb;
    text-align: center;
  }

  .logo {
    margin-bottom: 20px;
  }

  .logo img {
    height: 60px;
  }

  body.login-page h2 {
    margin-bottom: 25px;
    font-weight: 600;
  }

  body.login-page input {
    width: 100%;
    display: block;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.15);
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    outline: none;
  }

  body.login-page button {
    width: 100%;
    display: block;
    padding: 12px;
    border: none;
    background: #d52b1e;
    color: white;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.05em;
  }

  body.login-page button:hover {
    background: #b82218;
  }

  .error {
    margin-bottom: 15px;
    color: #ff0000;
    font-size: 13px;
    font-family: 'DM Mono', monospace;
    display: none;
  }
