/* Global Styles & Variables */
:root {
  --cta-background: #0ea5e9; /* sky-500 */
  --cta-text: #ffffff;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.body-styles {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-image: linear-gradient(to bottom right, #0f172a, #334155); /* from-slate-900 to-slate-700 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  margin: 0;
  color: white;
  overflow-x: hidden;
}

.body-styles::selection {
  background-color: #38bdf8; /* sky-400 */
  color: #0c4a6e; /* sky-900 */
}

/* App Structure */
.app-container {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  gap: 1.5rem;
}

.app-header {
  text-align: center;
}

.app-title {
  font-size: 2.25rem;
  font-weight: bold;
  letter-spacing: -0.025em;
}

.app-subtitle {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  color: #cbd5e1; /* text-slate-300 */
}

.app-footer {
  font-size: 0.875rem;
  color: #94a3b8; /* text-slate-400 */
}

/* Image Display Area */
.image-display-container {
  background-color: var(--cta-background);
  padding: 0.25rem;
  border-radius: var(--m423-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.image-display-area {
  background-color: black;
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-md);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Interaction Overlay - THE FIX */
#interaction-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20; /* Higher than quads and CTA */
  cursor: crosshair;
  touch-action: none; /* Ensure it handles all touch input */
}

/* Initial CTA Overlay */
.initial-cta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.4s ease-out;
  border-radius: inherit;
  pointer-events: none; /* Let clicks pass through to the interaction overlay */
}

.initial-cta-overlay.fade-out {
  opacity: 0;
}

.initial-cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #e2e8f0;
  padding: 1rem;
  height: clamp(100px, 40%, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: rgba(51, 65, 85, 0.7);
  transition: border-radius 0.2s ease-out;
}

.initial-cta-icon {
  font-size: 2rem;
  display: block;
}

.initial-cta-text {
  font-size: 1.125rem;
  font-weight: 500;
}

/* Controls Section */
.controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 28rem;
  gap: 1rem;
}

.button-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.image-info-text {
  font-size: 0.875rem;
  color: #cbd5e1;
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
}

.slider-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.slider-label {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.slider-input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #475569; /* slate-600 */
  outline: none;
  border-radius: 4px;
  transition: opacity .2s;
}
.slider-input:hover {
    opacity: 0.9;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--cta-background);
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid white;
}
.slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--cta-background);
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid white;
}

/* Basic button styling */
.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: bold;
  color: var(--cta-text);
  background-color: var(--cta-background);
  transition: opacity 0.23s ease-in-out;
  border: none;
  cursor: pointer;
}
.btn:hover {
  opacity: 0.85;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status messages (loading, error) */
.status-message-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background-color: rgba(0,0,0,0.5);
  border-radius: inherit;
}
.status-loading .status-text {
  color: #e2e8f0;
}
.status-error {
  color: #f87171; /* red-400 */
}
.status-title {
  font-weight: bold;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}
.status-text {
  margin-top: 1rem;
  font-size: 1rem;
}

/* Responsive Styles */
@media (min-width: 640px) {
  .app-container { gap: 2rem; }
  .app-title { font-size: 3rem; }
  .app-subtitle { font-size: 1.25rem; }
  .image-display-container { padding: 0.5rem; }
  .button-group { gap: 1rem; }
  .image-info-text { font-size: 1rem; }
}
