/* improved-style.css - Responsive, kid-friendly styling */

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
  color: #333;
  font-size: 14px;
}

/* Style for Capture Class buttons */
.capture-btn {
  font-size: 12px; /* Reduce font size for better fit */
  padding: 8px 12px; /* Adjust padding to make buttons smaller */
  white-space: nowrap; /* Prevent text wrapping */
}

/* Ensure the container keeps buttons in a single row */
.d-flex.flex-nowrap {
  overflow-x: auto; /* Allow horizontal scrolling if needed on small screens */
  gap: 10px; /* Ensure consistent spacing between buttons */
}

/* Adjust button margins for better spacing */
.capture-btn.m-1 {
  margin: 0 5px; /* Reduce margin to fit buttons in a row */
}
/* Typography */
h1 {
  color: #2196F3;
  text-align: center;
  margin-top: 15px;
  margin-bottom: 12px;
  font-size: 1.6rem;
}

h2, h3 {
  color: #1976D2;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.2rem;
}

/* Container settings */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 15px;
}

.main-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 15px;
}

.row {
  flex-wrap: wrap;
}

.col-md-6, .col-lg-5, .col-lg-7 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Cards and containers */
.card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 15px;
  background-color: white;
  overflow: hidden;
  padding: 15px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Webcam styling */
video {
  display: block;
  margin: 0 auto;
  background: #000000;
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

video:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Button styles */
button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-lg {
  font-size: 1rem;
}

.btn-success {
  background-color: #4CAF50;
  color: white;
}

.btn-info {
  background-color: #2196F3;
  color: white;
}

.btn-warning {
  background-color: #FFC107;
  color: #212529;
}

.btn-danger {
  background-color: #F44336;
  color: white;
}

/* Neural network visualization */
#nn-canvas {
  background-color: #f0f8ff;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin: 0 auto;
  display: block;
  width: 100%;
  height: 400px;
  min-height: 350px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.neural-network-container {
  position: relative;
  padding: 15px;
  margin: 20px 0;
  background-color: #f0f8ff;
  border-radius: 15px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
}

.nn-container {
  padding: 20px;
  margin-bottom: 25px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.layer-description {
  display: flex;
  justify-content: space-between; /* Updated for Task 1 */
  flex-wrap: nowrap;
  gap: 5px;
  margin-bottom: 10px;
  padding: 10px;
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
}

.layer-label {
  font-size: 10px;
  font-weight: bold;
  color: #333;
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  text-align: center;
  min-width: 75px;
  max-width: 95px;
  white-space: normal;
  line-height: 1.2;
  transition: all 0.2s ease;
  margin: 0 4px 8px 4px;
  display: inline-block;
}

.layer-label:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background-color: #e7f3ff;
  color: #0056b3;
}

.info-icon {
  font-size: 12px;
  cursor: pointer;
  color: #007bff;
  margin-top: 4px;
}

.info-icon:hover {
  color: #0056b3;
}

/* Kid-friendly intro text */
.kid-friendly-intro {
  background-color: #fffaed;
  border-radius: 12px;
  padding: 15px;
  border-left: 4px solid #ffc107;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin: 0 0 15px 0;
}

/* Description bubble */
.description-bubble {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  border: 3px solid #2196F3;
  border-radius: 15px;
  padding: 20px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 100;
  animation: bubble-appear 0.3s ease-out forwards;
}

@keyframes bubble-appear {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.bubble-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e1e1;
}

.bubble-emoji {
  font-size: 24px;
  margin-right: 10px;
}

.bubble-title {
  font-weight: bold;
  font-size: 16px;
  color: #007bff;
  flex-grow: 1;
}

.bubble-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 0 5px;
}

.bubble-text {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Prediction output styling */
#prediction-output {
  background-color: #e7f9ff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#prediction-output:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

#prediction-output h2 {
  color: #0056b3;
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#prediction-output h2 span {
  color: #ff6600;
  font-weight: bold;
}

/* Kid-friendly explanation */
.kid-friendly-explanation {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 15px;
  margin: 20px 0;
}

.kid-explanation {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f0f9ff;
  padding: 15px;
  border-radius: 12px;
  margin: 10px 0;
}

.kid-explanation .highlight {
  font-weight: bold;
  color: #0056b3;
  background-color: #e7f3ff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Tutorial overlay */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Darker shade for contrast */
  display: none; /* Initially hidden */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.tutorial-card {
  position: absolute;
  background: white;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  transition: all 0.3s ease; /* Smooth positioning */
  animation: bubble-appear 0.3s ease-out forwards;
}

/* Spotlight effect */
.tutorial-highlight {
  position: absolute;
  border: 3px solid #ffeb3b; /* Bright yellow border */
  border-radius: 10px;
  background: rgba(255, 235, 59, 0.2); /* Light yellow glow */
  box-shadow: 0 0 20px rgba(255, 235, 59, 0.5);
  z-index: 1001;
  transition: all 0.3s ease; /* Smooth movement */
}

.tutorial-card h3 {
  color: #2196F3;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.tutorial-card p {
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
}

.tutorial-card button {
  margin: 5px;
}

/* Adjust button styles within tutorial */
.tutorial-card .btn {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.help-button {
  position: fixed;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #ffeb3b, #ff9800); /* Vibrant yellow-orange gradient */
  color: #333;
  border: none;
  padding: 8px 16px;
  border-radius: 20px; /* Pill-shaped */
  cursor: pointer;
  z-index: 1001;
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.help-button:hover {
  background: linear-gradient(135deg, #ffd700, #f57c00);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.logout-button {
  position: fixed;
  top: 15px;
  right: 110px; /* Adjusted for the width of the "Tutorial" button */
  background: linear-gradient(135deg, #d3d3d3, #6c757d); /* Grayscale gradient */
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 1001;
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.logout-button:hover {
  background: linear-gradient(135deg, #b0b0b0, #495057);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* Kid-friendly buttons */
.kid-friendly-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px auto;
  max-width: 600px;
}

.control-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.kid-button {
  padding: 8px 15px;
  border-radius: 40px;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.kid-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.kid-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Reference panel */
.reference-panel {
  background-color: #f8f9fa;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reference-panel h4 {
  color: #6c757d;
  font-weight: bold;
}

.reference-panel h5 {
  background-color: #e9ecef;
  padding: 5px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.placeholder-box {
  width: 100%;
  height: 120px;
  background-color: #e9ecef;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2rem;
}

.reference-image {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: contain;
  border: 2px solid #dee2e6;
}

.kid-friendly-text {
  font-size: 14px;
  font-weight: bold;
  color: #6c757d;
}

/* Highlighted class animation */
@keyframes class-glow {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.highlighted-class {
  animation: class-glow 2s infinite;
  font-weight: bold;
  color: #ff4500;
}

/* Progress bar styling */
.progress {
  height: 18px;
  margin: 10px 0;
  background-color: #e9ecef;
  border-radius: 6px;
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

/* Alert styling */
.alert {
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Model summary container */
#model-summary-container {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
}

/* Two-column layout enhancements */
.sticky-top-custom {
  position: sticky;
  top: 20px;
  z-index: 10;
}

.webcam-container {
  max-width: 100%;
  margin-bottom: 30px;
}

.webcam-container video {
  max-width: 100%;
  border-radius: 12px;
}

.webcam-container .form-select {
  font-size: 12px; /* Smaller font size for better fit */
  padding: 5px; /* Reduce padding to save space */
}

/* Style for dropdowns in the Customize AI section */
.form-select {
  font-size: 14px; /* Slightly larger font for readability */
  padding: 5px; /* Adjust padding for better appearance */
}

/* Ensure the dropdowns in the col-4 columns are wide enough */
.row .col-4 .form-select {
  width: 100%; /* Use full width of the parent */
  max-width: 100px; /* Cap the width to avoid overflow */
  margin: 0 auto; /* Center the dropdown */
}

/* Adjust the col-4 columns to provide more space */
.row .col-4 {
  padding: 0 10px; /* Increase padding for better spacing */
}

/* Ensure labels are readable */
.form-label {
  font-size: 14px; /* Match the dropdown font size */
  margin-bottom: 5px; /* Add some space below the label */
}

/* Ensure labels are readable */
.webcam-container .form-label {
  font-size: 12px; /* Smaller font size for labels */
}


.webcam-container .row {
  flex-wrap: nowrap; /* Prevent wrapping to save space */
}

.webcam-container .col-4 {
  padding: 0 5px; /* Reduce padding to fit better */
}

.webcam-container input {
  font-size: 12px; /* Smaller font size for inputs */
}

.prediction-card {
  background-color: #e7f9ff;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.prediction-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.controls-container {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.explanation-section {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulse 2s infinite ease-in-out;
}

/* Media queries */
@media (min-width: 992px) {
  .col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 12px;
  }
  .container {
    padding: 0 10px;
  }
  h1 {
    font-size: 1.2rem;
  }
  h2 {
    font-size: 1rem;
  }
  button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  #nn-canvas {
    height: 250px;
  }
  .captured-images-container {
    max-height: 300px;
  }
  .captured-images-container img {
    max-width: 60px;
    max-height: 60px;
  }
  .help-button {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

@media (max-width: 991px) {
  /* Stack the columns vertically on smaller screens */
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .col-lg-3, .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Adjust the Neural Network Visualization height for smaller screens */
  #nn-canvas {
    height: 300px;
  }
  /* Ensure the Captured Images section is scrollable */
  .captured-images-container {
    max-height: 400px;
  }
  .captured-images-container img {
    max-width: 80px; /* Slightly larger images on smaller screens */
    max-height: 80px;
  }
}

@media (max-width: 768px) {
  .tutorial-card {
      max-width: 90%;
      padding: 15px;
  }

  .tutorial-card h3 {
      font-size: 1.2rem;
  }

  .tutorial-card p {
      font-size: 0.9rem;
  }

  .tutorial-highlight {
      border-width: 2px;
      box-shadow: 0 0 15px rgba(255, 235, 59, 0.4);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Semi-transparent dark background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* Higher than tutorial overlay (1000) */
  transition: opacity 0.5s ease; /* Smooth fade-out */
}

.loading-content {
  background: #fff;
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  width: 400px;
}

.loading-content h2 {
  color: #2196F3; /* Matches your primary blue */
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.loading-content p {
  font-size: 1rem;
  color: #333;
  font-weight: bold;
}

/* Spinning animation for the gear icon */
.spinning {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Adjust the Captured Images card for its new position */
.captured-images-container {
  max-height: 600px; /* Increased height to fit more images */
  overflow-y: auto; /* Allow scrolling if there are many images */
  padding: 10px;
}

/* Ensure images inside the Captured Images section are appropriately sized */
.captured-images-container img {
  max-width: 60px; /* Smaller images to fit the 25% column */
  max-height: 60px;
  object-fit: cover;
  border-radius: 5px;
}

/* Optional: Adjust the Neural Network card to ensure it looks centered */
#nn-placeholder, #nn-section {
  border: 3px solid #2196F3; /* Bright blue border to draw attention */
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15); /* Stronger shadow for emphasis */
  background-color: #e7f9ff; /* Light blue background to make it pop */
  transition: transform 0.3s ease;
}

#nn-placeholder:hover, #nn-section:hover {
  transform: scale(1.02); /* Slight zoom on hover to draw attention */
}

