body {
  font-family: 'Montserrat', sans-serif;
  margin: 20px;
  line-height: 1.6;
  background: #fff;
  color: #222;
  transition: background 0.3s, color 0.3s;
}


/* Typography */
h3, h4 {
  margin-top: 0;
  font-weight: 600;
  color: #333;
}

/* Base form elements */
textarea, input, button {
  font-family: inherit;
  font-size: 17px;
  line-height: 1.6;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 8px;
  transition: all 0.3s;
}

textarea, input {
  width: 97%;
  background: #fff;
  color: #222;
}

button {
  cursor: pointer;
  font-weight: 500;
}

/* Layout blocks */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.menu {
  display: flex;
  gap: 12px;
}

.menu a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: #222;
  transition: all 0.3s;
}
.menu a:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* --- Controls --- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  justify-content: flex-start;
}

.controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
}

.controls input[type="number"] {
  width: 80px;
  padding: 4px 6px;
  text-align: center;
}

/* Buttons */
.copy-btn {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
}
.copy-btn:hover {
  background: #005fcc;
}

.chunk-btn {
  background: #ff5733;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
}
.chunk-btn:hover {
  background: #e14a24;
}

.danger {
  background: #dc3545;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
}
.danger:hover {
  background: #b02a37;
}

/* --- Chunks --- */
.chunks-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.chunk {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.chunk-columns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.col {
  flex: 1 1 32%;
  min-width: 220px;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}
.col h4 { margin: 0 0 8px; font-size: 14px; }

.small {
    font-size: 13px;
    color: #2d2d2d;
}

.chunk-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.status { font-weight: 600; color: #555; }
.timer { font-weight: 600; color: green; }

.hidden { display: none; }

/* --- Rules box --- */
.rules-box {
  background: #eef;
  padding: 10px;
  border-radius: 6px;
  margin: 15px 0;
}
.rules-box textarea {
  resize: none;
  overflow: hidden;
  min-height: 120px;
  font-family: monospace;
}

/* --- Messages --- */
.msg { padding: 10px; border-radius: 6px; margin: 10px 0; }
.success { background: #d4edda; color: #155724; }
.error { background: #f8d7da; color: #721c24; }

/* --- Dark mode --- */
body.dark-mode {
  background: #1e1e1e;
  color: #eee;
}
body.dark-mode h3, 
body.dark-mode h4 {
  color: #ffd40b;
}
body.dark-mode textarea,
body.dark-mode input,
body.dark-mode .col {
  background: #2a2a2a;
  color: #eee;
  border-color: #555;
}
body.dark-mode .chunk { background: #2a2a2a; border-color: #444; }
body.dark-mode button {
  background: #444;
  color: #eee;
  border: 1px solid #666;
}
body.dark-mode button:hover { background: #555; }
body.dark-mode .copy-btn { background: #3399ff; }
body.dark-mode .copy-btn:hover { background: #2673cc; }

/* --- Toggle --- */
.toggle-bar {
  display: flex;
  gap: 20px;
  margin: 10px 0 20px;
}
.toggle-container {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
}
.toggle-container input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.toggle-container label {
  margin: 0;
  font-size: 16px;
  cursor: pointer;
}

.chunk-columns textarea {
  transition: all 0.15s ease;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  white-space: normal;
  line-height: 1.4;
}
.chunksWrapper {
    padding-bottom:50px ;
    
}

/* --- Project Selector --- */
.project-selector {
  margin: 10px 0;
  padding: 10px 12px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  transition: background 0.3s;
}

.project-selector:hover {
  background: #f3f3f3;
}

.project-selector label {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.project-selector select {
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  flex: 1 1 20px;
  min-width: 150px;
}

.project-selector select:hover {
  border-color: #007bff;
}

.project-selector #projectStatus {
  font-weight: 600;
  color: #28a745;
  white-space: nowrap;
}

/* --- Dark mode for Project Selector --- */
body.dark-mode .project-selector {
  background: #2a2a2a;
  border-color: #444;
}

body.dark-mode .project-selector label {
  color: #ffd40b;
}

body.dark-mode .project-selector select {
  background: #1e1e1e;
  color: #eee;
  border-color: #555;
}

body.dark-mode .project-selector select:hover {
  border-color: #3399ff;
}

body.dark-mode .project-selector select option {
  background: #1e1e1e;
  color: #eee;
}

body.dark-mode .project-selector #projectStatus {
  color: #4ade80;
}


body.dark-mode .small {
    font-size: 13px;
    color: #e8e8e8;
}

button.disabled-by-balance, .disabled-by-balance {
  opacity: 0.5;
  pointer-events: none; /* thêm lớp này chỉ nếu phù hợp */
}


button, a {
  margin-right: 5px;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
button:hover, a:hover { opacity: 0.85; }

/* --- Bottom Fixed Bar --- */
#bottomBar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1c2430;
  color: #eee;
  border-top: 1px solid #444;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  z-index: 9999;
  font-size: 14px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
}

/* Label và nhóm điều khiển */
#bottomBar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ddd;
  font-weight: 500;
}

#bottomBar input[type="number"],
#bottomBar input[type="range"] {
  border: 1px solid #555;
  background: #222;
  color: #eee;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
}

/* Buttons */
#bottomBar .copy-btn,
#bottomBar button,
#bottomBar a {
  background: #2d3a4a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

#bottomBar .copy-btn:hover,
#bottomBar button:hover,
#bottomBar a:hover {
  background: #007bff;
}

/* Khu Selected Summary */
#bottomBar #selectedChunksBar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  flex-wrap: wrap;
}


#toggleBottomBar {
  position: fixed;
  right: 12px;
  bottom: 180px; /* vị trí ban đầu */
  background: #2d3a4a;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
}
#toggleBottomBar:hover {
  background: #007bff;
}

#bottomBar {
  transition: transform 0.4s ease;
}

#bottomBar.hidden {
  transform: translateY(100%);
}


/* Smooth transitions for column visibility */
.chunk-columns {
  transition: all 0.3s ease;
}

.col {
  transition: all 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

/* When column is being hidden */
.col[data-column].hiding {
  opacity: 0;
  transform: scale(0.95);
}

/* Column Toggle Bar Styles */
#columnToggleBar {
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toggle button active states */
.toggle-col-btn {
  position: relative;
  overflow: hidden;
}

.toggle-col-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.toggle-col-btn:active::before {
  width: 300px;
  height: 300px;
}

/* Dark mode support for toggle controls */
body.dark-mode #columnToggleBar {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark-mode .toggle-col-btn {
  border-color: rgba(255,255,255,0.2);
}

/* Visual feedback for hidden columns */
.col[data-column][style*="display: none"] {
  pointer-events: none;
}

/* Highlight effect when toggling */
/*@keyframes highlightColumn {*/
/*  0%, 100% { box-shadow: 0 0 0 rgba(37, 99, 235, 0); }*/
/*  50% { box-shadow: 0 0 12px rgba(37, 99, 235, 0.6); }*/
/*}*/

.col.just-shown {
  animation: highlightColumn 0.8s ease;
}

/* Improved toggle bar appearance */
#columnToggleBar {
  position: relative;
  overflow: hidden;
}

#columnToggleBar::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  /*background: linear-gradient(*/
  /*  45deg,*/
  /*  transparent,*/
  /*  rgba(255, 255, 255, 0.1),*/
  /*  transparent*/
  /*);*/
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

/*@keyframes shimmer {*/
/*  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }*/
/*  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }*/
/*}*/

.muted {display: none;}

.bible-verse {
  margin-bottom: 12px;
  padding: 10px;
  background: #f0f9ff;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
}
.bible-ref {
  font-weight: bold;
  color: #1e40af;
}
.bible-text {
  color: #1f2937;
  line-height: 1.6;
}


/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    
    #toggleBottomBar {
  bottom: 490px; /* vị trí ban đầu */
  
  }
  body {
    margin: 10px;
    font-size: 15px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .menu {
    flex-wrap: wrap;
    gap: 6px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

    .chunk {
        border: 0px solid #ddd;
        border-radius: 10px;
        padding: 0px 0px 30px 0px;
        background: #fff;
    }

.chunksWrapper {
    padding-bottom: 50px;
    width: 105%;
}
  .chunk-columns {
    flex-direction: column;
  }
  
/*  .chunk-columns > :nth-child(3) {*/
/*  display: none;*/
/*}*/


  .col {
    flex: 1 1 100%;
    min-width: auto;
    width: 100%;
    border: 0px solid #ccc; 
  }


  .project-selector {
    flex-direction: column;
    align-items: stretch;
  }



  button, a {
    font-size: 14px;
    padding: 8px 10px;
  }

  table {
    font-size: 13px;
    overflow-x: auto;
    display: block;
  }

  th, td {
    padding: 8px;
  }
  
  .project-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .project-selector label {
    margin-bottom: 4px;
  }

  .project-selector select {
    width: 100%;
  }

  .project-selector #projectStatus {
    margin-top: 6px;
    text-align: right;
  }
   #bottomBar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 10px;
    gap: 12px;
    width: 95%;
  }



  #bottomBar label,
  #bottomBar div,
  #bottomBar button,
  #bottomBar a {
    width: 100%;
    justify-content: center;
  }

  #bottomBar input[type="range"] {
    width: 100%;
  }
  
  /*#btnCopyAllFinal,*/
  #loadJsonBtn,
  #downloadAllBtn
  /*#selectedChunksBar */
  {
    display: none !important;
  }
}
    #bottomBar input[type="range"] {
        width: 94%;
    }

/* Tablet (601–992px) */
@media (min-width: 601px) and (max-width: 992px) {
  body {
    margin: 15px;
    font-size: 16px;
  }

  .chunk-columns {
    flex-wrap: wrap;
  }

  .col {
    flex: 1 1 48%;
    min-width: 280px;
  }

  .menu {
    flex-wrap: wrap;
  }

  .controls {
    flex-wrap: wrap;
  }
  
  
}

/* Desktop (≥ 993px) */
@media (min-width: 993px) {
  .col {
    flex: 1 1 32%;
  }
}


