:root {
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --card-bg: rgba(30, 41, 59, 0.4);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.5;
  border-radius: 50%;
  animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: rgba(99, 102, 241, 0.3);
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: rgba(192, 132, 252, 0.2);
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fadeInDown 0.8s ease-out;
}

.logo-container {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #818cf8, #c084fc, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  line-height: 1.6;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 1s ease-out 0.3s both;
}

.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.upload-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.upload-card {
  border: 2px dashed rgba(129, 140, 248, 0.4);
  border-radius: 16px;
  padding: 4rem 2rem;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.3);
}

.upload-card:hover, .upload-card.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

#fileInput {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}

.upload-label svg {
  width: 64px;
  height: 64px;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.upload-card:hover .upload-label svg {
  transform: translateY(-5px);
}

.upload-text {
  font-size: 1.25rem;
  font-weight: 500;
}

.highlight {
  color: var(--accent);
}

.sub-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  animation: slideIn 0.3s ease-out;
}

.action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.primary-btn {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

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

.primary-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.results-title h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 1200px;
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  font-variant-numeric: tabular-nums;
}

th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: #141c2f;
  z-index: 1;
}

th.sticky-col {
  background: #192238;
}

td.sticky-col:nth-child(2) {
  left: 100px; /* Adjust based on AcNo width */
}
th.sticky-col:nth-child(2) {
  left: 100px;
}

/* Status styles */
.status-paid {
  color: var(--success);
  font-weight: 600;
  background: var(--success-bg);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  display: inline-block;
}

.status-unpaid {
  color: var(--danger);
  font-size: 0.85rem;
  background: var(--danger-bg);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  display: inline-block;
}

.total-col {
  font-weight: 700;
  color: var(--accent);
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .app-container { padding: 1.5rem 1rem; }
  .glass-panel { padding: 1.5rem; }
  .upload-card { padding: 2rem 1rem; }
}
