/* --- GLOBAL RESET --- */
body, html {
    margin: 0; padding: 0;
    background-color: #121212; 
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    overflow: hidden; 
    height: 100vh; width: 100vw;
}

/* --- LAYOUT --- */
main {
    position: absolute;
    top: 32px; left: 32px; right: 32px; bottom: 32px; 
    display: flex; justify-content: center; align-items: center;
    z-index: 1;
    pointer-events: none; 
}

/* --- CANVAS --- */
canvas {
    display: block;
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
    border-radius: 8px;
    max-width: 100%; 
    max-height: 100%; 
    width: auto !important; 
    height: auto !important;
    pointer-events: auto; 
}
/* Fonts - Ensure these are loaded in your project */
:root {
  --font-heading: 'Stack Sans Notch', sans-serif;
  --font-body: 'Stack Sans', sans-serif;
  --color-primary-blue: #001FDF; /* Matching your screenshot blue */
  --color-text-main: #1a1a1a;
  --color-bg-white: #ffffff;
}

/* Overlay Background - High Z-Index to sit on top of EVERYTHING */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 30, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999; /* Increased to ensure it covers the Drop Zone and UI */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Right Side: Animation Container - No Padding */
.modal-visual {
  flex: 1;
  background-color: #f0f0f5; 
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0; /* Ensures lottie touches the edges */
  height: 100%; /* Forces full height */
}

/* Ensure the container fills the visual area */
#lottie-container {
  width: 100%;
  height: 100%;
  display: block; /* Removes default inline spacing */
  line-height: 0; /* Removes vertical gaps */
}


/* The Modal Box */
.modal-content {
  background: var(--color-bg-white);
  width: 90%;
  max-width: 800px;
  height: 400px; /* Fixed height for consistency */
  border-radius: 0px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

/* Open State Classes (toggled via JS) */
.modal-overlay.is-visible {
  opacity: 1;
}
.modal-overlay.is-visible .modal-content {
  transform: translateY(0);
}

/* Left Side: Text */
.modal-text {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.modal-heading {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-primary-blue);
  margin-bottom: 8px;
  font-weight: 700; /* Adjust based on font weight availability */
}

.modal-description {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--color-text-main);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* CTA Button */
.cta-btn {
  font-family: var(--font-body);
  background-color: var(--color-primary-blue);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  width: fit-content;
  transition: background-color 0.2s;
}

.cta-btn:hover {
  background-color: #0015a0;
}

/* Right Side: Animation Container */
.modal-visual {
  flex: 1;
  background-color: #f0f0f5; /* Light grey bg for contrast, or match the pink if preferred */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#lottie-container {
  width: 120%; /* Slightly larger to fill space if needed */
  height: 100%;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  color: #666;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    flex-direction: column-reverse; /* Animation on top for mobile */
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-visual {
    height: 200px;
    flex: none;
  }
  .modal-text {
    padding: 24px;
  }
}
/* --- UI CONTAINER --- */
#ui-container {
    position: fixed;
    top: 32px; right: 32px;
    width: 280px;
    z-index: 2000; 
    display: flex; flex-direction: column; gap: 8px;
    
    /* ENABLE SCROLL for small screens */
    max-height: calc(100vh - 64px); 
    overflow-y: auto;
    
    /* Allow popups to render without clip inside the scroll area */
    overflow-x: visible; 
    
    /* CRITICAL: Buffer at bottom so popups aren't cut off */
    padding-bottom: 300px;
    
    pointer-events: auto; 
}

/* Hide Scrollbar but keep functionality (Optional, cleaner look) */
#ui-container::-webkit-scrollbar { width: 6px; }
#ui-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
#ui-container::-webkit-scrollbar-track { background: transparent; }

/* --- TWEAKPANE OVERRIDES --- */
#pane-mount { width: 100%; }
.tp-dfwv { 
    width: 100% !important; 
    min-width: unset !important;
    /* Ensure Tweakpane itself doesn't clip */
    overflow: visible !important; 
}
.tp-p-b { overflow: visible !important; }
.tp-v-p { z-index: 9999 !important; }

/* --- CLOSE BUTTON --- */
#close-file-btn {
    position: fixed;
    top: 32px; left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; align-items: center; gap: 6px;
}
#close-file-btn:hover {
    background: rgba(255, 60, 60, 0.2);
    border-color: rgba(255, 60, 60, 0.5);
    color: #ff6464;
}
#close-file-btn.hidden { display: none; }

/* --- TABS --- */
.mode-tabs {
    display: flex; gap: 4px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(12px);
    padding: 4px; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
}
.tab-btn {
    flex: 1;
    background: transparent; border: none;
    color: #888;
    padding: 8px 0;
    font-size: 13px; font-weight: 600;
    border-radius: 4px; cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.tab-btn.active { background: #00c864; color: #111; }

/* --- OVERLAY --- */
#drop-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(18, 18, 18, 0.85); 
    z-index: 1500; 
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s;
}
#drop-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-content {
    text-align: center;
    border: 2px dashed #444;
    padding: 60px 80px;
    border-radius: 16px;
    background: #1a1a1a;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: border-color 0.2s;
}
.overlay-content:hover { border-color: #00c864; }

.drop-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.drop-message { font-size: 20px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.drop-sub { color: #666; margin-bottom: 16px; font-size: 14px; }

.select-file-btn {
    background: #00c864; color: #000;
    border: none; padding: 10px 24px;
    font-size: 14px; font-weight: 700;
    border-radius: 6px; cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}
.select-file-btn:hover { background: #00e070; transform: scale(1.02); }
.select-file-btn:active { transform: scale(0.98); }

/* --- FOOTER --- */
.app-footer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    z-index: 100; padding: 12px 32px; 
    background: transparent;
    pointer-events: none; 
}
.footer-content {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: #666;
    pointer-events: auto;
}





