/* main.css - Core application styles */

/* Resets and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background-color: #f9fafb; /* Gray-50 */
  color: #1f2937; /* Gray-800 */
  line-height: 1.5;
}

/* Prevent scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Main layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Module container */
.module-container {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  min-height: 200px;
}

/* Modal container */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  pointer-events: auto;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.modal-content {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  padding: 1rem;
}

/* Spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top: 3px solid #5d42c4;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tab-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(93, 66, 196, 0.3);
  border-radius: 50%;
  border-top: 2px solid #5d42c4;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Notification system */
.notification {
  background-color: white;
  border-left: 4px solid #10b981; /* Emerald-500 */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1rem;
  margin-bottom: 0.75rem;
  animation: notificationFadeIn 0.3s ease-out;
  position: relative;
  border-radius: 0.375rem;
}

.notification-error {
  border-left-color: #ef4444; /* Red-500 */
}

.notification-warning {
  border-left-color: #f59e0b; /* Amber-500 */
}

.notification-info {
  border-left-color: #3b82f6; /* Blue-500 */
}

.notification-success {
  border-left-color: #10b981; /* Emerald-500 */
}

.notification-timer {
  height: 3px;
  background-color: #e5e7eb; /* Gray-200 */
  width: 100%;
  position: relative;
}

.notification-timer-progress {
  height: 100%;
  background-color: #10b981; /* Emerald-500 */
  transition: width linear;
}

.notification-error .notification-timer-progress {
  background-color: #ef4444; /* Red-500 */
}

.notification-warning .notification-timer-progress {
  background-color: #f59e0b; /* Amber-500 */
}

.notification-info .notification-timer-progress {
  background-color: #3b82f6; /* Blue-500 */
}

/* Form elements */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db; /* Gray-300 */
  border-radius: 0.375rem;
  background-color: #fff;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: #5d42c4; /* Brand-purple */
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 66, 196, 0.2);
}

/* Improved progress bar */
.relative.pt-1.mb-6 {
  margin-top: 1rem;
  position: relative;
}

.overflow-hidden.h-2.text-xs.flex.rounded.bg-gray-200 {
  height: 12px !important; /* Much thicker progress bar */
  border-radius: 8px;
  background-color: #e5e7eb;
  overflow: hidden;
  position: relative;
}

#progress-bar {
  transition: width 0.5s ease-in-out;
  height: 100%;
  background: linear-gradient(90deg, #5d42c4 0%, #7a61e0 100%);
  box-shadow: 0 2px 4px rgba(93, 66, 196, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; /* Ensure there's always room for the text */
}

#progress-bar.complete {
  animation: progressPulse 1.5s ease-in-out;
}

#progress-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

@keyframes progressPulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* Responsive tab navigation for results */
#resultTabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  white-space: nowrap;
  padding-bottom: 5px;
  position: relative;
}

#resultTabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

#resultTabs a {
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

#resultTabs a.active {
  border-bottom-color: #5d42c4;
  color: #5d42c4;
  font-weight: 500;
}

/* Make sure tab content takes full width */
#resultTabsContent {
  width: 100%;
}

/* Keyframe animations */
@keyframes notificationFadeIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes notificationFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

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

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

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

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