body {
      margin: 0;
      font-family: Arial, sans-serif;
      display: flex;
      height: 100vh;
      overflow: hidden;
      flex-direction: column;
    }


/* ===== MAIN HEADER / TOOLBAR ===== */
     .toolbar {
      position: fixed;
      display: flex;
      align-items: center;
      width: 100%;
      gap: 10px;
      padding: 8px 12px;
      background: #fff;
      border-bottom: 1px solid #ddd;
      overflow-x: auto;
    }

.toolbar::-webkit-scrollbar {
  width: 6px;
  height: 4px; /* agar horizontal scroll aaye toh */
}

.toolbar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.toolbar::-webkit-scrollbar-thumb:hover {
  background: #999;
}



    .toolbar button {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 16px;
      color: #444;
      padding: 6px;
      border-radius: 4px;
    }

    .toolbar button:hover {
      background: #f8f9fa;
    }
    
    .toolbar button.active {
  background: #f8f9fa;
  color: #3c4043;
}

    .toolbar select {
      padding: 4px 6px;
      border-radius: 4px;
      border: none;
      outline: none;
    }
    .toolbar select:hover {
      background: #f1f3f4;
    }
    

    .divider {
      width: 1px;
      background: #ddd;
      height: 24px;
      margin: 0 6px;
    }


    /* Content area below toolbar */
.content {
  display: flex;
  height: calc(100vh - 50px); /* adjust 50px if toolbar height changes */
  margin-top: 50px;
  overflow: hidden;
}


/* Sidebar */
    .sidebar {
      width: 270px;
      background: #fff;
      color: black;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
    }

    .sidebar h2 {
      font-size: 18px;
      margin: 15px 20px;
    }

    /* ===== Keyword Box with Line Numbers ===== */
    .keyword-container {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .line-numbers {
      background: #f2f2f2;
      padding: 20px 5px;
      text-align: right;
      user-select: none;
      font-size: 16px;
      padding-top: 0;
      color: #555;
      line-height: 1.5;
      border-right: 1px solid #cbd5e1;
      overflow: hidden;
    }

    .line-numbers div {
      height: 1.5em; /* match line height */
    }

    .keyword-box {
      font-family: 'Roboto', 'Open Sans', 'Lato', Arial, sans-serif;
      flex: 1;
      width: 100%;
      background: #fff;
      color: black;
      box-sizing: border-box;
      padding: 20px;
      padding-top: 0;
      border: none;
      resize: none;
      font-size: 16px;
      outline: none;
      line-height: 1.5;
      white-space: pre-wrap;
      overflow-y: auto;
    }
/* WebKit Browsers (Chrome, Edge, Safari) */
.keyword-box::-webkit-scrollbar {
  width: 6px;
}

.keyword-box::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.keyword-box::-webkit-scrollbar-thumb:hover {
  background: #999;
}



    /* Main Editor */
    .main {
      flex: 1;
      background: #f0f1f2;
      display: flex;
      flex-direction: column;
    }
    /* Editor scrollable */
.editor {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f0f1f2;
}
        /* WebKit Browsers (Chrome, Edge, Safari) */
.editor::-webkit-scrollbar {
  width: 6px;
  height: 12px;
}

.editor::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.editor::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
  cursor: pointer;
}

.editor::-webkit-scrollbar-thumb:hover {
  background: #999;
}


/* Article box */
#articleBox {
  min-height: 100%;       /* instead of 100vh, let it grow naturally */
  width: 100%;
  font-size: 16px;
  line-height: 1.6;
  padding: 25px;
  box-sizing: border-box;
  outline: none;
  background: white;
  overflow: auto;       /* allow scrolling inside */
}
/* WebKit Browsers (Chrome, Edge, Safari) */
#articleBox::-webkit-scrollbar {
  width: 6px;
  height: 12px;
}

#articleBox::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

#articleBox::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
  cursor: pointer;
}

#articleBox::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Images inside editor */
#articleBox img {
  max-width: 600px;        /* full width if needed */
  max-height: 320px;
  width: 100%;
  height: 100%;
  display: block;
  margin: 15px auto;      /* space around */
}


/* Placeholder */
#articleBox:empty:before {
  content: attr(placeholder);
  color: #aaa;
}
}

.toolbar button.active {
  background: #e0e0e0;   /* highlight color */
  color: #000;
}

/* highlight selected image */
#articleBox img.selected {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}


/* Paragraph default size */
#articleBox p {
  font-size: 16px;   /* slightly smaller than before */
  line-height: 1.7;
  margin: 0 0 10px;
}

/* Heading hierarchy */
#articleBox h1 { font-size: 28px; font-weight: bold; margin: 20px 0 10px; }
#articleBox h2 { font-size: 26px; font-weight: bold; margin: 18px 0 10px; }
#articleBox h3 { font-size: 22px; font-weight: bold; margin: 16px 0 8px; }
#articleBox h4 { font-size: 20px; font-weight: bold; margin: 14px 0 6px; }
#articleBox h5 { font-size: 18px; font-weight: bold; margin: 12px 0 6px; }
#articleBox h6 { font-size: 16px; font-weight: bold; margin: 10px 0 4px; }

/* Save status */
#saveStatus {
  font-size: 14px;
  color: #555;
  margin-right: 33px;   /* add space from right edge */
  white-space: nowrap;  /* keep text in one line */
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;             /* space between icon and text */
}

#saveStatus.saving #saveIcon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Wrap sidebar + button in a container */
.sidebar-right-wrapper {
  display: flex;
  flex-direction: row;
  position: relative;
  height: 100%;
}

/* Right Sidebar */
.sidebar-right {
  width: 270px;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: width 0.3s ease;
}

/* Collapse Button */
#toggleSidebar {
  width: 20px;
  border: none;
  background: #f8f9fa;
  border-radius: 4px 0 0 4px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar collapsed */
.sidebar-right.collapsed {
  width: 0;
  overflow: hidden;
  border: none;
}

.sidebar-right.collapsed ~ #toggleSidebar {
  right: 0; /* move button closer */
}

/* Top buttons in right sidebar */
.sidebar-right .top-buttons {
  display: flex;
  padding: 5px;
  padding-bottom: 0;
  border-bottom: 1px solid #eee;
}

.sidebar-right .top-buttons button {
  flex: 1;
  padding: 10px 15px;
  border: black;
  font-size: 14px;
  cursor: pointer;
  border-left: 1px solid #dadce0;
  border-right: 1px solid #dadce0;
  background: #f8f9fa; /* tool-related blue */
  color: #3c4043;
  transition: 0.2s;
}

.sidebar-right .top-buttons button:hover {
  background: #f1f3f4;   /* Slightly darker on hover */
  border-color: #3c4043;
}

/* Highlight active tab in right sidebar */
.sidebar-right .top-buttons button.active {
  background: #4285f4;   /* Google blue */
  color: #fff;           /* white text */
  font-weight: bold;
}

/* Stats Tab keyword row as button-style container */
#statsTab .count-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  margin: 3px 0;
  font-size: 14px;
  padding: 15px;
  background: #c1f0c1;   /* ✅ green only for Stats */
  transition: background 0.3s;
}

/* Count Tab rows (no green background) */
#countTab .count-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;

  font-size: 14px;
  padding: 15px;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-bottom: 0;
  background: #f8f9fa;   /* ✅ keep clean */
}

#statsTab {
  display: block;
  padding: 10px;
  max-height: 100vh;   /* ya jitna chaho */
  overflow-y: auto;    /* vertical scroll enable */
  box-sizing: border-box;
}
#statsTab::-webkit-scrollbar {
  width: 6px;
}
#statsTab::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
#statsTab::-webkit-scrollbar-thumb:hover {
  background: #999;
}


/* ✅ Semantic Tab keyword row (same layout as Stats) */
#semanticTab .count-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  margin: 3px 0;
  font-size: 14px;
  padding: 15px;
  background: #c1f0c1;   /* 🍊 light orange semantic tab ke liye */
  transition: background 0.3s;
}

/* ✅ Scroll enable for Semantic Tab */
#semanticTab {
  display: block;
  padding: 10px;
  max-height: 100vh;     /* screen ke andar hi fit */
  overflow-y: auto;      /* vertical scroll */
  box-sizing: border-box;
}
#semanticTab::-webkit-scrollbar {
  width: 6px;
}
#semanticTab::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
#semanticTab::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ✅ Scroll enable for Count Tab */
#countTab {
  display: block;
  padding: 10px;
  max-height: 100vh;   /* screen ke andar hi fit */
  overflow-y: auto;    /* vertical scroll enable */
  box-sizing: border-box;
}
#countTab::-webkit-scrollbar {
  width: 6px;
}
#countTab::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
#countTab::-webkit-scrollbar-thumb:hover {
  background: #999;
}


/* Stats Tab keyword row as button-style container */
.count-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
 
  margin: 3px 0;
  font-size: 14px;
  padding: 15px;
  background: #c1f0c1;   /* light green background like button */
  transition: background 0.3s;
}

/* keyword label inside row */
.count-row .kw-label {
  color: black;
  background: transparent; /* remove duplicate background */
  padding: 0;
  margin-right: 10px;
}

/* bar styling */
.count-row .bar {
  background: #e0e0e0;
  height: 4px;
  border-radius: 3px;
  overflow: hidden;
  margin-right: 10px;
}
.count-row .bar div {
  background: #4285f4;  /* keep blue fill */
  height: 100%;
  width: 0;
  transition: width 0.3s;
  
}

/* counter */
.count-row span:last-child {

}




@media (max-width: 992px) {
  #toggleSidebar {
    right: 0;
  }
}



    /* ===== Responsive Sidebar ===== */
@media (max-width: 568px) {
  .sidebar {
    width: 150px;  /* hide off-screen */

    height: 100%;
    z-index: 1000;
   overflow-y: auto;
  }
/* WebKit Browsers (Chrome, Edge, Safari) */


.sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #999;
}

}