:root {
  /* Premium Dark Theme - Deep Frost */
  --glass-bg: rgba(10, 10, 15, 0.5); /* Darker, more transparent */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --glass-blur: blur(40px); /* Increased blur */
  --glass-glow: 0 0 20px rgba(129, 140, 248, 0.15); /* Subtle glow */

  /* Typography */
  --font-family: "Inter", sans-serif;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;

  /* Accents */
  --brand-primary: #6366f1;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --brand-hover: #4f46e5;

  --success: #10b981;
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  /* Spacing */
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 50px; /* More rounded for modern feel */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  overflow: hidden; /* No scroll on HTML */
}

body {
  font-family: var(--font-family);
  /* Premium Aurora Background */
  background-color: #030014;
  background-image: radial-gradient(
      circle at 15% 50%,
      rgba(99, 102, 241, 0.25),
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(139, 92, 246, 0.25),
      transparent 25%
    ),
    radial-gradient(
      circle at 50% 90%,
      rgba(16, 185, 129, 0.15),
      transparent 40%
    );
  background-attachment: fixed;
  background-size: 100% 100%; /* Radial gradients don't animate well with position alone if size is huge, let's use a pseudo element or safer huge gradient logic. */
  /* Actually the best "Aurora" CSS usually involves filtering or huge moving blobs.
     Let's try a safer animated gradient mesh approach that is performant.
  */
  background: radial-gradient(
      circle at 0% 0%,
      rgba(58, 29, 92, 0.6) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(30, 27, 75, 0.6) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(49, 46, 129, 0.6) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(17, 24, 39, 0.6) 0%,
      transparent 50%
    ),
    linear-gradient(135deg, #0f0c29 0%, #000000 100%);
  background-size: 200% 200%;
  animation: aurora 20s ease infinite;

  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh; /* Fixed height */
  margin: 0;
  overflow: hidden; /* No scroll on Body */
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

@keyframes aurora {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Video Background Removed */

.container {
  max-width: 900px;
  margin: 0 auto; /* Removed top margin, providing it via padding if needed */
  padding: 40px 24px;
  height: 100%;
  overflow-y: auto; /* Internal scrolling */
  width: 100%;

  /* Custom Scrollbar for Container */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Custom Scrollbar Styling (Webkit) */
.container::-webkit-scrollbar {
  width: 8px;
}

.container::-webkit-scrollbar-track {
  background: transparent;
}

.container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Header */
header {
  margin-bottom: 48px;
  text-align: center;
  flex-shrink: 0;
}

header h1 {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #ffffff 20%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Sections */
.section-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--glass-shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: fadeUp 0.6s ease-out forwards;
  position: relative;
  overflow: hidden;
}

.section-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

.section-panel:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 48px 0 rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin: 24px 0 12px 0;
}

.hint {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Forms */
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  font-family: inherit;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

input:focus,
textarea:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--brand-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

textarea {
  min-height: 200px;
  resize: vertical;
}

/* File Input */
input[type="file"] {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 20px;
  padding: 10px 20px;
  border: none;
  background: var(--brand-gradient);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

input[type="file"]::file-selector-button:hover {
  transform: scale(1.05);
  background: var(--brand-gradient);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn.primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn.success {
  background: var(--success-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn.success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

/* Badge */
.badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(4px);
}

/* Analysis Results & Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.info-value {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.status-msg {
  font-size: 14px;
  color: var(--success);
  margin-top: 12px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Line Items */
.line-items-wrapper {
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-md) !important;
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.line-items-header {
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr; /* Matches renderLineItems implicitly if used grid there, but original code injected rows differently. Let's fix row CSS below */
  display: flex !important; /* Reverting to flex if existing JS uses flex or block divs */
  justify-content: space-between; /* Fallback */
}

/* Actually, the HTML structure in renderLineItems uses divs.
   The original CSS had .line-items-header as a flex/grid setup?
   Looking at previous file reading:
   .line-items-header { ... } and .line-item-row { ... }
   Wait, the JS creates divs. Let's make sure we have a grid layout for the table feel.
*/

.line-items-header,
.line-item-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 3fr; /* Description, Qty, Unit, Match */
  gap: 16px;
  padding: 16px;
  align-items: center;
}

.line-items-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.line-item-row {
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s;
  color: var(--text-primary);
}

.line-item-row:last-child {
  border-bottom: none;
}

.line-item-row:hover {
  background: rgba(255, 255, 255, 0.1);
}

.match-box {
  background: rgba(16, 185, 129, 0.15); /* Green tint for match */
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.match-title {
  color: #34d399;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.match-meta {
  display: flex;
  gap: 8px;
}

.match-meta span {
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Proposal Preview - Keep it looking like a document, but floating in glass */
.proposal-preview {
  background: white;
  border: none;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 40px;
  font-family: "Times New Roman", serif;
  color: #000;
  border-radius: 4px;
  max-height: 500px;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Scrollbar styling for webkit */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
