/* --- GLOBAL STYLES --- */

/* Import fonts - Open Sans for all text */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables have been moved to ../shared-code/css-variables.css */
/* Note: The consolidated css-variables.css file includes all the color and spacing variables 
   that were previously defined here. Market Size Explorer specific variables that aren't
   in the shared file should be added to a :root block below if needed. */

/* Market Size Explorer specific variables */
:root {
  /* Shadow variables - Mindstate: Minimal single shadows */
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-large: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-inset: none; /* Mindstate: No inset shadows */

  /* Typography variables - MSE specific */
  --font-heading: 'Open Sans', monospace;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height-tight: 1.4;   /* MSE specific */
  --line-height-loose: 1.8;   /* MSE specific */
}

/* Base element styling - MOVED TO tea-explorer-global-styles.css */
/* body and .container styles are now centralized in tea-explorer-global-styles.css
   This ensures consistent styling across all platform pages.
   
   Market Size Explorer specific overrides can be added here if needed,
   but the base styles are inherited from the global stylesheet.
*/

/* Enhanced typography for headings - base styles */
h1,
h2,
h3,
h4 {
  color: var(--text-dark);
  margin-top: 0;
  font-weight: 600;
  line-height: 1.3;
}

/* Specific styling for the main page title (H1) */
/* Commenting out to defer to tea-explorer-global-styles.css
h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; // Fallback
  text-shadow: 1px 1px 2px var(--color-shadow-light);
  position: relative;
  letter-spacing: -0.5px;
}
*/

/* Underline effect for the main H1 */
/* Commenting out to defer to tea-explorer-global-styles.css
h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  border-radius: 2px;
}
*/

/* Custom scrollbar styling for WebKit browsers (Chrome, Safari, Edge) */
/* Commenting out to defer to tea-explorer-global-styles.css
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(to right, var(--terminal-bg), var(--background-light));
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-light), var(--primary-dark));
  border-radius: 8px;
  border: 3px solid var(--terminal-bg); // Creates a "floating" thumb effect
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--primary), var(--primary));
}
*/

/* Custom scrollbar styling for Firefox */
/* Commenting out to defer to tea-explorer-global-styles.css
body,
textarea,
div { // Apply to elements that might scroll
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--terminal-bg);
}
*/

/* Animation keyframes have been moved to ../shared-code/animations.css */
/* Note: The gradientMove animation is MSE-specific and remains below */

/* Animations are now imported from ../shared-code/animations.css */
/* Note: Kept MSE-specific animations that don't exist in shared animations */

@keyframes pulseMessage { /* Used by no-files-message - MSE specific */
  0% { transform: scale(1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */ }
  100% { transform: scale(1.02); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */ }
}

@keyframes fadeInStaggered { /* MSE specific - might be used by JS */
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Global Loading Overlay Styling */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(235, 236, 240, 0.8); /* Matches --color-bg with opacity */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  display: none; /* Hidden by default, shown by JS */
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(28, 160, 149, 0.2); /* --primary with opacity */
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  box-shadow: 0 0 15px rgba(28, 160, 149, 0.3); /* --primary with opacity */
  position: relative;
}

.loading-spinner::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 5px solid transparent;
  border-bottom-color: var(--primary-light);
  opacity: 0.7;
  animation: spin 1.2s linear infinite reverse;
}

/* Styling for the message when no analysis files are found */
.no-files-message {
  text-align: center;
  padding: 40px;
  background: linear-gradient(145deg, var(--card-bg), var(--card-bg-hover));
  border-radius: 16px;
  margin: 40px auto;
  max-width: 600px;
  border: 1px solid var(--border);
  box-shadow:
    -8px -8px 16px var(--color-shadow-light),
    8px 8px 16px var(--color-shadow-dark),
    inset 1px 1px 1px var(--color-shadow-light);
  animation: pulseMessage 6s infinite alternate;
}

.no-files-message h3 {
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
  margin-bottom: 15px;
  padding-left: 0; /* Override card h3 style */
  font-size: 1.6rem;
}

.no-files-message p {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.7;
}

.no-files-message pre {
  margin: 15px 0;
  padding: 15px;
  border-radius: 8px;
  background: #1a1a1a; /* Dark background for code block */
  color: #ddd;
  overflow: auto;
  text-align: left;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Global Utility Classes */
.full-width { /* Utility class for grid items to span all columns */
  grid-column: 1 / -1;
}

.loading-shimmer { /* Utility for applying a shimmer effect to elements during loading */
  position: relative;
  overflow: hidden;
}

.loading-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: loading 1.5s infinite;
}

.pulse-highlight { /* Utility for applying a pulse animation */
  animation: pulse 2s infinite;
}

/* Subtle hover transitions for many interactive elements (global catch-all) */
/* Note: This selector is very broad and includes shared components.
   It's considered global due to its wide application for consistent UX. */
a, button, .tab, .card, .metric-card, .insight-item, .glossary-term, .missing-data-item, .funnel-step, .metric-group {
  transition: all var(--transition-medium) ease;
}

/* Responsive adjustments for Global elements */
@media (max-width: 768px) {
  /* Global elements like dashboard and key-insights-list are adjusted,
     but their specific class styles are in 'Shared' or 'Tab-Specific'.
     Only directly global element adjustments are listed here. */
  h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
  }

  h1::after {
    width: 80px;
    height: 3px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 12px;
  }

  h1 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
  }

  h1::after {
    width: 60px;
    height: 3px;
  }
}