/* ===== BASE STYLES ===== */
:root {
  --primary: #1a7f75; /* Darker teal */
  --primary-dark: #12665e;
  --primary-light: #e0f2f1;
  --secondary: #2c3e50;
  --accent: #ff7043;
  --light-bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #555555;
  --border: #e0e0e0;
  --success: #2ecc71;
  --warning: #e74c3c;
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1000px;
  --side-margin: 20px;
  --sidebar-width: 280px;
  --nav-height: 60px;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--light-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-margin);
  width: 100%;
  box-sizing: border-box;
}

/* ===== HEADER STYLES ===== */
header {
  background-color: var(--primary);
  padding: 12px 20px; /* Reduced padding */
  color: #fff;
  text-align: center;
}

.tool-header {
  background-color: var(--primary);
  color: white;
  padding: 20px 0; /* Reduced vertical padding */
  margin-bottom: 20px; /* Reduced margin */
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-margin);
}

/* Standard h1 size (smaller than original) */
.tool-header h1 {
  margin: 0;
  font-size: 1.75rem; /* Reduced from 2rem */
  line-height: 1.2;
}

/* Compact h1 variation */
.tool-header h1.compact {
  font-size: 1.5rem; /* Even smaller size */
  line-height: 1.1;
  margin-bottom: 4px; /* Tight spacing */
}

.tool-header p {
  margin: 6px 0 0; /* Reduced margins */
  opacity: 0.9;
  font-size: 0.95em; /* Slightly smaller paragraph */
}

/* Ultra-compact header variation */
.header-ultra-compact {
  padding: 8px 0; /* Minimal padding */
}

.header-ultra-compact h1 {
  font-size: 1.25rem;
  line-height: 1;
  margin: 0;
}

.header-ultra-compact p {
  margin: 2px 0 0;
  font-size: 0.85em;
}

/* ===== MAIN CONTENT STYLES ===== */
main {
  max-width: 900px;
  margin: 30px auto;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.content-wrapper {
  margin-right: 260px;
  transition: margin-right 0.3s ease;
}

.section {
  margin-bottom: 30px;
}

.section pre {
  background: #f1f1f1;
  padding: 15px;
  border-radius: 5px;
  white-space: pre-wrap;
}

/* ===== NAVIGATION ===== */
.main-nav {
  background-color: var(--secondary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-margin);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: bold;
  font-size: 1.2rem;
  padding: 15px 0;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin-left: 20px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 15px 0;
  display: flex;
  align-items: center;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-links a:hover {
  color: var(--primary-light);
}

.nav-links a i {
  margin-right: 8px;
}

.nav-links .active a {
  border-bottom-color: var(--primary);
  color: white;
  font-weight: 500;
}

/* ===== CARD STYLES ===== */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 25px;
  overflow: hidden;
}

.card-header {
  background-color: var(--primary);
  color: white;
  padding: 15px 20px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  border-bottom: none;
}

.card-header i {
  margin-right: 10px;
}

.card-body {
  padding: 20px;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 15px;
}

.modern-input, .modern-select, .modern-textarea,
input, select, textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 1em;
  box-sizing: border-box;
  transition: var(--transition);
  background-color: white;
  margin-top: 5px;
  margin-bottom: 15px;
}

.modern-input:focus, .modern-select:focus, .modern-textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 127, 117, 0.2);
}

.modern-textarea, textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===== BUTTONS ===== */
.button-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 25px 0;
}

.btn-primary, .btn-secondary, .btn-action, .btn-continue,
button {
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: white;
  margin-top: 15px;
}

.btn-primary:hover, button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #1a252f;
  transform: translateY(-2px);
}

.btn-action {
  background-color: var(--light-bg);
  color: var(--secondary);
  border: 1px solid var(--border);
}

.btn-action:hover {
  background-color: #e0e5eb;
}

.btn-continue {
  background-color: var(--accent);
  color: white;
}

.btn-continue:hover {
  background-color: #f45c2c;
  transform: translateY(-2px);
}

button i {
  margin-right: 8px;
}

/* ===== RESPONSE BOXES ===== */
.response-box, #aiResponse {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  white-space: pre-wrap;
}

.classification-box {
  padding: 12px;
  background: #ecf8f2;
  border-left: 5px solid #2ecc71;
  margin-bottom: 20px;
  font-weight: bold;
}

.info-row {
  display: flex;
  margin-bottom: 8px;
}

.info-label {
  font-weight: 600;
  min-width: 160px;
  color: var(--secondary);
}

.info-value {
  color: var(--text);
}

.error {
  color: var(--warning);
  font-weight: 500;
}

.success {
  color: var(--success);
  font-weight: 500;
}

.status-box {
  padding: 12px;
  margin: 15px 0;
  border-radius: var(--border-radius);
  background-color: #f8f9fa;
  border: 1px solid var(--border);
  font-size: 0.9em;
}

/* ===== PROGRESS BAR ===== */
#progressBar {
  width: 100%;
  background: #f0f0f0;
  margin: 15px 0;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  display: none;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#progressBar.active {
  display: block;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    var(--primary), 
    #2a9d8f 20%, 
    #3ab7a8 40%, 
    var(--primary-dark) 60%, 
    var(--primary) 80%);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.4s ease-out;
  animation: 
    progressPulse 1.5s ease-in-out infinite,
    progressShine 2s ease-in-out infinite;
  position: relative;
}

/* ===== NBC REFERENCES ===== */
.nbc-tip {
  font-size: 0.85em;
  color: var(--text-light);
  margin: 5px 0 0;
}

.nbc-tip a {
  color: var(--primary);
  text-decoration: none;
}

.nbc-tip a:hover {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  margin-top: 40px;
  color: #777;
}

/* ===== ANIMATIONS ===== */
@keyframes progressPulse {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes progressShine {
  0% { 
    opacity: 0;
    transform: translateX(-100%) skewX(-20deg); 
  }
  50% { opacity: 0.8; }
  100% { 
    opacity: 0;
    transform: translateX(100%) skewX(-20deg); 
  }
}

/* ===== HELP MENU & DROPDOWN STYLES ===== */
.help-menu {
  position: relative;
}

.help-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 400px;
  max-height: 500px;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 8px;
  z-index: 1000;
  overflow: hidden;
}

.help-menu:hover .help-dropdown {
  display: block;
}

.help-iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 8px;
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-bg);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  z-index: 1;
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--text);
  padding: 12px 16px;
  display: block;
}

.dropdown-content a:hover {
  background-color: var(--primary-light);
  color: var(--secondary);
}

/* ===== TOOLS SIDEBAR ===== */
.tools-sidebar {
  width: var(--sidebar-width);
  background-color: #1e293b;
  border-left: 1px solid #334155;
  padding: 24px 0;
  position: fixed;
  top: var(--nav-height);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 90;
  color: #f8fafc;
}

.tools-sidebar-header {
    padding: 0 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.tools-sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
	color: #f8fafc;
    margin-bottom: 8px;
}

/* Ultra-Compact Tool Cards */
.tools-card {
    padding: 6px 12px;
    margin: 8px 0;
    border-radius: 0px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tools-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.tools-card p {
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tools-card.demo {
  border-left-width: 2px;
}

.tools-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tools-card.disabled-tool {
  background-color: rgba(150, 150, 150, 0.3);
  cursor: not-allowed;
  pointer-events: none;
  padding: 6px 12px;
  border-left-width: 2px;
}

.tools-card:hover {
  background-color: #334155;
  transform: none;
}

.tools-menu-toggle {
  display: none;
  position: fixed;
  right: 16px;
  top: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 100;
  font-size: 0.9rem;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1024px) {
  .content-wrapper {
    margin-right: 0;
  }
  
  .tools-sidebar {
    transform: translateX(100%);
    width: 240px;
  }
  
  .tools-sidebar.open {
    transform: translateX(0);
  }
  
  .tools-menu-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    padding: 10px;
  }
  
  .nav-logo {
    padding: 10px 0;
  }
  
  .nav-links {
    width: 100%;
    justify-content: space-around;
  }
  
  .nav-links li {
    margin: 0;
  }
  
  .nav-links a {
    padding: 10px 5px;
    font-size: 0.9em;
  }
  
  .button-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .button-group button {
    width: 100%;
  }
  
  .info-row {
    flex-direction: column;
  }
  
  .info-label {
    margin-bottom: 4px;
  }
  
  .card-header {
    padding: 10px 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  .form-group {
    margin-bottom: 10px;
  }
  
  .button-group {
    margin: 12px 0;
  }
  
  .help-dropdown {
    width: 300px;
    max-height: 400px;
    right: -50px;
  }
  
  .help-iframe {
    height: 400px;
  }
  
  .tools-card {
    padding: 5px 10px;
  }
  .tools-card h3 {
    font-size: 0.8rem;
  }
  .tools-card p {
    font-size: 0.7rem;
  }
}