/* Footer active colour – exactly the same as in account.html */
.footer-item.active,
.footer-item.active i,
.footer-item.active span {
  color: #ffd78a !important;
}

  /* Corrected Google Fonts URL */
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

  html,body{height:100%; margin:0; font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;}
  body{
    background: linear-gradient(180deg,#070716 0%, #0f0b1a 100%);
    color:#e6e8ee;
    overflow:hidden;
  }

  /* Main container for desktop view */
  .main-container {
    height: 100%;
    width: 100%;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
  }
  @media (min-width: 800px) {
    .main-container {
      max-width: 450px; /* Or your preferred max-width for desktop */
      height: 100vh;
      /* Simulates a device frame on desktop */
      border-left: 1px solid rgba(255,255,255,0.05);
      border-right: 1px solid rgba(255,255,255,0.05);
    }
  }

  /* Reel wrapper */
  #reel{
    position:relative;
    width:100%;
    height: calc(100% - 60px);
    overflow:hidden;
  }

  .slide {
    position:absolute;
    top:0; left:0;
    width:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    align-items:stretch;
    transition:transform .45s cubic-bezier(.22,.9,.25,1);
    will-change:transform;
  }

  /* Top bar with small labels */
  .top-bar {
    position:absolute;
    top:10px;
    left:10px;
    right:10px;
    display:flex;
    justify-content:space-between;
    gap:8px;
    z-index:30;
    pointer-events:none;
  }
  .chip {
    pointer-events:auto;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(0,0,0,0.45);
    border:1px solid rgba(255,255,255,0.03);
    font-size:13px;
    color:#cbd5ff;
    display:flex;
    gap:8px;
    align-items:center;
    cursor:pointer;
  }

  /* Chart area - height adjusted */
  .chart-area{
    position:absolute;
    top:50px;
    left:10px;
    right:10px;
    height:40%; /* <-- ADJUSTED HEIGHT */
    border-radius:12px;
    overflow:hidden;
    background:linear-gradient(180deg, rgba(10,12,20,0.6), rgba(8,9,15,0.85));
    border:2px solid rgba(255,255,255,0.03);
    z-index:10;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px;
    padding-right: 65px;
    padding-bottom: 50px;
    box-sizing:border-box;
    flex-direction:column;
  }

  .chart-area canvas{ width:100% !important; height:100% !important; }

  /* Bottom info area */
  .bottom-panel{
    position:relative;
    z-index:20;
    bottom:0; /* Changed from fixed bottom to allow natural flow */
    margin: 0 12px 18px 12px;
    background:linear-gradient(180deg, rgba(10,10,18,0.6), rgba(6,6,12,0.8));
    border-radius:14px;
    padding:12px;
    border:1px solid rgba(255,255,255,0.03);
    box-shadow: 0 8px 24px rgba(2,4,10,0.6);
  }

  .price{
    font-weight:700;
    /* Responsive font size */
    font-size: clamp(28px, 8vw, 34px);
    line-height:1;
    background:linear-gradient(90deg,#a770ef,#f76bf3 60%, #ffd18a);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
  }

  .small {
    color:#b9bed6;
    font-size:13px;
  }

  .stat-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
    margin-top:10px;
  }
  
  /* Added a breakpoint for tablets */
  @media (min-width: 600px) {
    .stat-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  @media (min-width: 800px) {
    .stat-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }


  .stat {
    background:rgba(255,255,255,0.02);
    border-radius:10px;
    padding:8px;
    text-align:center;
    border:1px solid rgba(255,255,255,0.02);
  }
  /* Responsive stat value font size */
  .stat .val{ font-weight:700; color:#f1f5f9; font-size: clamp(12px, 3vw, 14px); }
  .stat .lbl{ font-size:12px; color:#9aa0c7; }

  /* Right menu, aligned with chart card - position adjusted */
  .right-menu {
    position: absolute;
    margin-right: 10px;
    right: 10px;
    /* Adjusted to be centered with the new 45% chart height */
    top: calc(40px + 22.5vh); /* <-- ADJUSTED POSITION (22.5 is half of 45) */
    transform: translateY(-65%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 40;
  }

  .action {
    width:56px; height:56px;
    border-radius:14px;
    display:flex; align-items:center; justify-content:center;
    background:linear-gradient(180deg, rgba(15,15,25,0.6), rgba(8,8,12,0.6));
    border:1px solid rgba(255,255,255,0.04);
    box-shadow:0 8px 20px rgba(0,0,0,0.5);
    cursor:pointer;
    transition:transform .15s ease, background .15s;
    color:#ffd78a;
  }
  .action:hover{ transform:translateY(-4px) scale(1.03); }
  .action.active { color: #a770ef; }

  /* Time filter row */
  .time-row {
    display:flex; gap:12px; margin-top:15px; align-items:center;
    position:absolute; bottom:12px; left:12px; right:12px;
  }

  .time-qty, .time-filter {
    padding:6px 10px; border-radius:8px; background:rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.02); font-size:13px; color:#ffd6aa;
    cursor:pointer;
  }

  .time-filter.active {
    background: rgba(167, 112, 239, 0.3);
    color: #a770ef;
    border-color: rgba(167, 112, 239, 0.5);
  }

  /* Change percentage row */
  .change-row {
    margin-top:12px;
    display:flex;
    flex-wrap: wrap;
    gap:8px;
    justify-content: flex-start;
    align-items: center;
  }
  
  /* Markets & Audit Button */
  .action-buttons-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .markets-btn {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.02);
    color: #c9cde7;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
  }
  .markets-btn:hover { background: rgba(255,255,255,0.06); }

  /* Generic Modal Styles */
  .modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 11, 26, 0.9);
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 10vh;
    z-index: 10001; opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  .modal-overlay.visible { opacity: 1; pointer-events: auto; }
  .modal-content {
    background: #0f0b1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; width: 90%; max-width: 600px;
    display: flex; flex-direction: column;
    transform: scale(0.95); transition: transform .3s ease;
  }
  .modal-overlay.visible .modal-content { transform: scale(1); }
  .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .modal-header h2 { margin: 0; font-size: 18px; }
  .modal-close-btn { background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; }
  .modal-body { padding: 16px; overflow-y: auto; max-height: 60vh; }

  /* Markets Modal */
  .market-item {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
    padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px; align-items: center;
  }
  .market-item:last-child { border-bottom: none; }
  .market-name { font-weight: 600; }
  .market-price, .market-volume { text-align: right; color: #cbd5ff; }

  /* Search Modal */
  #search-input {
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 12px; color: #fff; font-size: 16px; margin-bottom: 16px;
  }
  #search-results .result-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    border-radius: 8px; cursor: pointer; transition: background .2s;
  }
  #search-results .result-item:hover { background: rgba(255,255,255,0.05); }
  #search-results .result-item img { width: 32px; height: 32px; border-radius: 50%; }

  /* Comments Modal */
  .modal-footer {
    padding: 12px; border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; gap: 10px;
  }
  #comment-input {
    flex-grow: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 10px; color: #fff;
  }
  #comment-post-btn {
    background: #a770ef; color: #fff; font-weight: 600;
    border: none; border-radius: 8px; padding: 0 20px; cursor: pointer;
  }
  .comment-item {
    padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .comment-item:last-child { border-bottom: none; }
  .comment-meta { font-size: 12px; color: #9aa0c7; margin-bottom: 4px; }
  .comment-text { color: #e6e8ee; }

  /* Responsive tweaks for smaller devices */
  @media (max-width:380px) {
    .chip { padding: 5px 8px; font-size: 12px; }
    .change-row { gap: 4px; font-size: 11px; }
  }

  @media (max-width:640px){
    .action{ width:48px; height:48px; }
    .right-menu {
        /* Adjusted for smaller screen top position */
        top: calc(52px + 22.5vh); /* <-- ADJUSTED POSITION */
        right: 10px;
    }
    .change-row { gap:6px; font-size:12px; }
    .time-qty, .time-filter { font-size:12px; padding:5px 8px; }
  }

  .loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 11, 26, 0.9);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: #e6e8ee; font-size: 20px; z-index: 10000;
  }
  .loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #a770ef;
    border-radius: 50%; width: 40px; height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
  }
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

  /* Footer Menu */
  .footer-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(180deg, #0f0b1a, #070716);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
  }
  .footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #cbd5ff;
    font-size: 12px;
    cursor: pointer;
  }
  .footer-item i {
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  /* --- NEW STYLES --- */

  /* For the new info icon */
  .info-btn {
    cursor: pointer;
    color: #9aa0c7;
    transition: all .2s ease;
  }
  .info-btn:hover {
    color: #ffd78a !important; /* Use a highlight color */
    transform: scale(1.15);
  }

  /* Style for the info modal body content */
  #info-modal-body a {
    color: #a770ef;
    text-decoration: none;
    font-weight: 600;
  }
  #info-modal-body a:hover {
    text-decoration: underline;
  }