* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow-x: hidden;
}

/* Content Grid Layout - 4 Column Structure */
.content-grid {
  display: grid;
  grid-template-columns: 25% 25% 23% 25%;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: hidden;
}

/* Column Styles */
.column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Wrapper for අඤ්ඤසමාන sections */
.anghasamana-wrapper {
  background-color: #e8f5e9;
  border: 3px solid #2e7d32;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wrapper-title {
  font-size: 18px;
  font-weight: bold;
  color: #1b5e20;
  margin-bottom: 8px;
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 2px solid #4caf50;
}

.anghasamana-wrapper .section {
  margin-bottom: 8px;
}

.anghasamana-wrapper .section:last-child {
  margin-bottom: 0;
}

/* Wrapper for අකුසල sections */
.akushala-wrapper {
  background-color: #fce4ec;
  border: 3px solid #c2185b;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.akushala-wrapper .wrapper-title {
  color: #880e4f;
  border-bottom: 2px solid #e91e63;
}

.akushala-wrapper .section {
  margin-bottom: 6px;
  min-height: auto;
  padding: 8px;
}

.akushala-wrapper .section:last-child {
  margin-bottom: 0;
}

/* Wrapper for සොභන sections - Column 1 (Yellow) */
.sobhana-wrapper-1 {
  background-color: #fffde7;
  border: 3px solid #f57f17;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sobhana-wrapper-1 .wrapper-title {
  color: #f57f17;
  border-bottom: 2px solid #fdd835;
}

.sobhana-wrapper-1 .section {
  margin-bottom: 6px;
  min-height: auto;
  padding: 8px;
}

.sobhana-wrapper-1 .section:last-child {
  margin-bottom: 0;
}

/* Wrapper for සොභන sections - Column 2 (Yellow - same as Column 1) */
.sobhana-wrapper-2 {
  background-color: #fffde7;
  border: 3px solid #f57f17;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sobhana-wrapper-2 .wrapper-title {
  color: #f57f17;
  border-bottom: 2px solid #fdd835;
}

.sobhana-wrapper-2 .section {
  margin-bottom: 6px;
  min-height: auto;
  padding: 8px;
}

.sobhana-wrapper-2 .section:last-child {
  margin-bottom: 0;
}

/* Section Styles */
.section {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 10px;
  min-height: auto;
}

.section h2 {
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: bold;
}

.section h3 {
  font-size: 14px;
  margin: 6px 0 4px 0;
  font-weight: 600;
}

/* Color Schemes */
.green-section {
  background-color: #c8e6c9;
  border-color: #4caf50;
}

.pink-section {
  background-color: #f8bbd0;
  border-color: #e91e63;
}

.yellow-section {
  background-color: #fff9c4;
  border-color: #fdd835;
}

.orange-section {
  background-color: #ffe0b2;
  border-color: #ff9800;
}

.blue-section {
  background-color: #c8e6c9;
  border-color: #4caf50;
}

.chart-section {
  background-color: #e8f5e9;
  border-color: #4caf50;
  margin-top: 8px;
  padding-bottom: 20px;
}

/* Checkbox List */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}

.checkbox-list input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Chart Container */
.chart-container {
  display: flex;
  align-items: center;
  height: 180px;
  margin-top: 6px;
  position: relative;
  padding: 0;
}

.y-axis {
  display: none;
}

.y-label {
  display: none;
}

#progressChart {
  width: 100%;
  height: 100%;
}

.x-axis {
  display: none;
}

.x-label {
  display: none;
}

/* Bottom Section */
.bottom-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
}

.button-group {
  display: flex;
  gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-reload {
  padding: 8px 16px;
  border: 2px solid #333;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-primary {
  background-color: #c8e6c9;
  color: #000;
}

.btn-primary:hover {
  background-color: #a5d6a7;
}

.btn-secondary {
  background-color: #90caf9;
  color: #000;
}

.btn-secondary:hover {
  background-color: #64b5f6;
}

.btn-reload {
  background-color: #fff59d;
  color: #000;
}

.btn-reload:hover {
  background-color: #fff59d;
}

.progress-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

#progressCount {
  color: #e91e63;
  font-size: 18px;
}

/* Notes Section */
.notes-section {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 10px;
  background-color: #f5f5f5;
}

.notes-section h3 {
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: bold;
}

#notesArea {
  width: 100%;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .column {
    width: 100%;
  }

  .bottom-section {
    flex-direction: column;
    gap: 15px;
  }

  .button-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary,
  .btn-reload {
    width: 100%;
  }
}

/* Checked State */
input[type="checkbox"]:checked + label {
  text-decoration: line-through;
  color: #666;
}

/* Frame Refresh Button */
.frame-refresh-btn {
  width: 100%;
  padding: 8px 16px;
  margin-top: 8px;
  background-color: #90caf9;
  border: 2px solid #1976d2;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  transition: all 0.3s;
}

.frame-refresh-btn:hover {
  background-color: #64b5f6;
  border-color: #1565c0;
}

.frame-refresh-btn:active {
  background-color: #42a5f5;
  transform: scale(0.98);
}

/* Custom Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 500px;
  max-width: 650px;
  animation: slideDown 0.3s ease;
  border: 3px solid #1976d2;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  padding: 15px 20px;
  border-radius: 9px 9px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}

.modal-body {
  padding: 25px 20px;
  background-color: #f9f9f9;
}

.modal-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  white-space: pre-line;
}

.modal-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background-color: #fff;
  border-radius: 0 0 9px 9px;
}

.modal-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 110px;
  text-align: center;
}

.modal-btn-cancel {
  background-color: #e0e0e0;
  color: #333;
  border: 2px solid #bdbdbd;
}

.modal-btn-cancel:hover {
  background-color: #bdbdbd;
  border-color: #9e9e9e;
}

.modal-btn-confirm {
  background-color: #4caf50;
  color: #fff;
  border: 2px solid #388e3c;
}

.modal-btn-confirm:hover {
  background-color: #388e3c;
  border-color: #2e7d32;
  transform: scale(1.05);
}

.modal-btn:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  .modal-content {
    min-width: 90%;
    max-width: 90%;
  }
}
