/* filepath: c:\\Reza\\my-github-repos\\openai-node-example\\public\\css\\style.css */
:root {
  /* Light theme (default) */
  --bg-color: #f8f9fa;
  --bg-container: white;
  --text-color: #212529;
  --header-bg: #f8f9fa;
  --header-border: #e9ecef;
  --header-text: #2c3e50;
  --card-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  --code-bg: #f8f9fa;
  --border-accent: #0dcaf0;
  --border-secondary: #6c757d;
  --question-container-bg: #e6f0ff; /* Change from #f1f8ff to #e6f0ff for more visible blue */
  --question-border: #0d6efd;
  --api-container-bg: #fff8f1;
  --api-border: #fd7e14;
  --muted-text: #6c757d;
  --button-bg: #28a745;
  --button-hover: #218838;
}

/* Dark theme */
.dark-mode {
  --bg-color: #121212;
  --bg-container: #1e1e1e;
  --text-color: #e1e1e1;
  --header-bg: #252525;
  --header-border: #333;
  --header-text: #e1e1e1;
  --card-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
  --code-bg: #2d2d2d;
  --border-accent: #0099cc;
  --border-secondary: #999999;
  --question-container-bg: #252d3b;
  --question-border: #3b5998;
  --api-container-bg: #3b2e1e;
  --api-border: #b25d00;
  --muted-text: #aaaaaa;
  --button-bg: #2a9d8f;
  --button-hover: #218380;
}

/* Add these specific elements to ensure dark mode is visible */
.dark-mode body {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

.dark-mode .card,
.dark-mode .card-body,
.dark-mode .question-type-container,
.dark-mode .api-key-container,
.dark-mode .app-container {
  background-color: var(--bg-container) !important;
  color: var(--text-color) !important;
}

.dark-mode pre,
.dark-mode code {
  background-color: var(--code-bg) !important;
  color: #e1e1e1 !important;
}

.dark-mode .form-control {
  background-color: #333 !important;
  color: #e1e1e1 !important;
  border-color: #555 !important;
}

.dark-mode .card-header {
  background-color: var(--question-container-bg) !important;
}

.dark-mode .submit-btn {
  background-color: var(--button-bg) !important;
  border-color: var(--button-bg) !important;
}

.dark-mode .submit-btn:hover {
  background-color: var(--button-hover) !important;
  border-color: var(--button-hover) !important;
}

/* Base styling */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

.app-container {
  background-color: var(--bg-container);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  transition: background-color 0.3s;
}

/* Update app header styling */
.app-header {
  border-bottom: 2px solid var(--header-border);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  background-color: var(--header-bg);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
}

.app-title {
  color: var(--header-text);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--muted-text);
  margin-top: 0.5rem;
}

/* Form styling */
.question-type-container {
  background-color: var(--question-container-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--question-border);
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.api-key-container {
  background-color: var(--api-container-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--api-border);
}

/* Change button styling for better contrast */
.submit-btn {
  background-color: #28a745 !important; /* Green button instead of blue */
  border-color: #28a745 !important;
  padding: 0.75rem 2.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  color: white !important;
}

.submit-btn:hover {
  background-color: #218838 !important;
  border-color: #218838 !important;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Code and output styling */
pre code {
  white-space: pre !important;
  display: block;
  overflow-x: auto;
  background-color: var(--code-bg);
  border-radius: 8px;
  padding: 1.25rem;
  border-left: 4px solid var(--border-accent);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* ASCII diagram styling */
.ascii-diagram {
  font-family: 'Courier New', monospace;
  white-space: pre;
  line-height: 1.2;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  display: inline-block;
  margin: 1rem 0;
  border-left: 4px solid #0dcaf0;
}

/* Card and output styling */
.card {
  background-color: var(--bg-container);
  border: none;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  animation: slideInFromBottom 0.4s ease-out;
  transition: transform 0.3s, box-shadow 0.3s; /* Add this line */
}

.card-header {
  background-color: var(--question-container-bg) !important;
  border-bottom: none;
  padding: 1rem 1.5rem;
  border-radius: 8px 8px 0 0 !important;
  border-left: 4px solid var(--question-border); /* Add this line */
}

.card-body {
  padding: 1.5rem;
}

/* Solution toggle button styles */
.solution-button {
  background-color: #0d6efd; /* Change from #6c757d (gray) to #0d6efd (blue) */
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  margin: 16px auto;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: block !important; /* Change from flex to block */
  text-align: center;
  width: fit-content;
  margin-left: auto !important;
  margin-right: auto !important;
}

.solution-button:hover {
  background-color: #0b5ed7; /* Darker blue hover state */
  transform: translateY(-2px);
}

.solution-content {
  display: none;
  border-left: 4px solid #0d6efd; /* Change this to match the button */
  padding-left: 1rem;
  margin: 1rem 0;
}

.solution-button i {
  margin-right: 8px;
}

/* Spinner and loading state */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 2rem 0;
}

.loading-text {
  margin-top: 1rem;
  color: #6c757d;
  font-weight: 500;
}

/* Add this to your CSS for prettier tree diagrams */
pre code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 1rem;
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #0dcaf0;
  line-height: 1.4;
  tab-size: 4;
}

/* Add this to your CSS */
@keyframes slideInFromBottom {
  0% {
    transform: translateY(40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Add this to your CSS for better section separation */
.card-body h2 {
  border-bottom: 2px solid var(--header-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--header-text);
}

.task-section {
  background-color: #f8f9fa;
  border-left: 4px solid #0d6efd;
  padding: 1.25rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.floating-generate-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.floating-generate-button .btn {
  width: 60px;
  height: 60px;
  border-radius: 50% !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-generate-button .btn i {
  font-size: 1.5rem;
}

.floating-button-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.floating-generate-button:hover .floating-button-tooltip {
  opacity: 1;
}

/* Only show floating button when there's content */
.floating-generate-button {
  display: none;
}

/* Add to your style section in search.ejs */
.theme-toggle-container {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-color);
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.theme-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode .theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dark-icon {
  display: inline-block;
}

.light-icon {
  display: none;
}

.dark-mode .dark-icon {
  display: none;
}

.dark-mode .light-icon {
  display: inline-block;
}

/* Add this to your CSS in search.ejs */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.theme-toggle-btn {
  background: rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-color);
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.dark-mode .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Add this to your existing styles in the bootstrappedOutput section */
.additional-resources {
  background-color: var(--bg-container);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  border-left: 4px solid #6f42c1;
}

.additional-resources h2 {
  color: #6f42c1;
  font-size: 1.4rem;
}

.additional-resources a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.additional-resources a:hover {
  text-decoration: underline;
}

/* Video resource styling */
.video-resource {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.video-resource:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.dark-mode .video-resource:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.video-icon {
  color: #ff0000;
  font-size: 1.5rem;
  margin-right: 1rem;
}

/* Add this to your CSS in search.ejs */
.btn-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Make the button text show "Working..." when disabled */
.submit-btn:disabled .submit-button-text {
  opacity: 0.8;
}

/* Add this to your CSS in the style section */
.card-header h1 {
  color: #000000 !important; /* Black text for light theme */
  font-weight: 700;
}

/* For other heading levels too */
.card-header h2, 
.card-header h3, 
.card-header h4 {
  color: #000000 !important; /* Black text for light theme */
  font-weight: 600;
}

/* Keep the headings visible in dark mode */
.dark-mode .card-header h1,
.dark-mode .card-header h2,
.dark-mode .card-header h3,
.dark-mode .card-header h4 {
  color: #ffffff !important; /* White text for dark mode */
}

/* Add this to your CSS */
.dark-mode .form-text {
  color: #aaaaaa !important; /* Light gray color for better visibility */
}

/* Add rule for footer in dark mode */
.dark-mode footer.text-muted {
  color: #aaaaaa !important;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Add this to your CSS in search.ejs */
@media (max-width: 768px) {
  /* Improve toggle button positioning on mobile */
  .theme-toggle-btn {
    position: absolute;
    top: 15px; /* Move it higher in the header */
    right: 15px; /* Keep it on the right but with more margin */
    z-index: 100; /* Ensure it's clickable */
  }
  
  /* Adjust title spacing to prevent overlap */
  .app-header h1 {
    padding-right: 50px; /* Make space for the button */
    margin-bottom: 15px; /* Add more margin below the title */
  }
  
  /* Reduce title font size on very small screens */
  @media (max-width: 380px) {
    .app-header h1 {
      font-size: 1.5rem;
    }
  }
}
