:root {
	--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
	--success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
	--accent-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
	--warning-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
	--dark-bg: #0f172a;
	--card-bg: rgba(255, 255, 255, 0.95);
	--glass-bg: rgba(255, 255, 255, 0.1);
	--text-primary: #1e293b;
	--text-secondary: #64748b;
	--border-color: rgba(148, 163, 184, 0.2);
	--shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
	box-sizing: border-box;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--primary-gradient);
	min-height: 100vh;
	padding: 0;
	margin: 0;
	position: relative;
	overflow-x: hidden;
}

body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.15"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.15"/><circle cx="90" cy="30" r="0.5" fill="white" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
	pointer-events: none;
	z-index: -1;
}

.main-container {
	padding: 2rem 1rem;
	max-width: 1600px;
	margin: 0 auto;
}

.hero-section {
	text-align: center;
	margin-bottom: 3rem;
	position: relative;
}

.hero-title {
	font-size: 3.5rem;
	font-weight: 700;
	background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 1rem;
	text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
	font-size: 1.25rem;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 400;
	margin-bottom: 2rem;
	animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInFromLeft {
	from {
		opacity: 0;
		transform: translateX(-50px);
	}

	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes bounceIn {
	0% {
		opacity: 0;
		transform: scale(0.8);
	}

	50% {
		transform: scale(1.05);
	}

	100% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}

.glass-card {
	background: var(--card-bg);
	backdrop-filter: blur(20px);
	border: 1px solid var(--border-color);
	border-radius: 24px;
	box-shadow: var(--shadow-heavy);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	animation: slideInFromLeft 0.8s ease-out;
	position: relative;
	overflow: hidden;
}

.glass-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.glass-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.35);
}

.upload-section {
	padding: 3rem;
	text-align: center;
	position: relative;
}

.upload-icon {
	font-size: 4rem;
	background: var(--success-gradient);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.5rem;
	display: block;
	animation: bounceIn 1s ease-out 0.5s both;
}

.upload-label {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	display: block;
}

.upload-description {
	color: var(--text-secondary);
	margin-bottom: 2rem;
	font-size: 1.1rem;
}

.file-input-wrapper {
	position: relative;
	display: inline-block;
	overflow: hidden;
	background: var(--primary-gradient);
	color: white;
	padding: 1rem 2.5rem;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 500;
	font-size: 1.1rem;
	box-shadow: var(--shadow-medium);
	border: none;
}

.file-input-wrapper:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2);
	animation: pulse 1s infinite;
}

.file-input-wrapper input[type="file"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.stats-overview {
	margin: 2rem 0;
	padding: 2rem 3rem;
}

.stats-overview div {
	justify-content: center;
}

.stat-card {
	background: white;
	border-radius: 20px;
	padding: 2rem;
	text-align: center;
	box-shadow: var(--shadow-light);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	min-height: 200px;
}

.stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: var(--primary-gradient);
}

.stat-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-medium);
}

.stat-number {
	font-size: 3rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
}

.stat-label {
	font-size: 1rem;
	color: var(--text-secondary);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.charts-section {
	margin: 3rem 0;
	padding: 3rem;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.6s ease;
}

.charts-section div {
	justify-content: center;
}

.charts-section.visible {
	opacity: 1;
	transform: translateY(0);
}

.chart-container {
	position: relative;
	height: 400px;
	margin-bottom: 2rem;
}

.chart-wrapper {
	background: white;
	border-radius: 20px;
	margin-left: auto;
	margin-right: auto;
	padding: 2rem;
	box-shadow: var(--shadow-light);
	height: 100%;
	transition: transform 0.3s ease;
	width: 100%;
	position: relative;
}

.chart-wrapper:hover {
	transform: scale(1.02);
}

.chart-wrapper::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 6px;
	background: var(--primary-gradient);
}

.chart-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 1rem;
	text-align: center;
}

.table-section {
	margin-top: 2rem;
	animation: slideInFromLeft 0.8s ease-out 0.4s both;
}

.table-container {
	background: white;
	border-radius: 24px;
	overflow: hidden;
	box-shadow: var(--shadow-heavy);
	position: relative;
	padding: 1.5rem;
}

.table-container .dataTables_scrollHead table,
.table-container .dataTables_scrollBody table {
  width: 100% !important;     /* let DataTables stretch columns */
}

.table-container .dataTables_scrollBody {
  overflow-x: auto !important;
}

#logTable {
	margin: 0 !important;
	border-collapse: separate;
	border-spacing: 0;
}
#logTable thead {
	flex: 1;
}

#logTable thead th {
	background: var(--primary-gradient);
	color: white;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 0.875rem;
	padding: 1.5rem 1rem;
	border: none;
	/* position: sticky; */
	position: static;
	top: 0;
	z-index: 10;
}

#logTable tbody tr {
	transition: all 0.2s ease;
	border-bottom: 1px solid #f1f5f9;
}

#logTable tbody tr:hover {
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	transform: scale(1.001);
}

#logTable tbody td {
	padding: 1rem;
	border: none;
	vertical-align: top;
	max-width: 300px;
	word-wrap: break-word;
	min-height: 100px;
}

#logTable tbody td pre {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 0.75rem;
	margin: 0;
	font-size: 0.875rem;
	max-height: 200px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

#logTable tbody td:has(.modal-cell-content) {
  height: 100px;
  vertical-align: middle;
  padding: 0.5rem;
}
/* Alternative approach if :has() is not supported */
#logTable tbody td .modal-cell-content {
  height: 80px;
}

.dataTables_wrapper {
	padding: 2rem;
}

.dataTables_length select,
.dataTables_filter input {
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	transition: all 0.3s ease;
}

.dataTables_length select:focus,
.dataTables_filter input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dataTables_paginate .paginate_button {
	border: none !important;
	background: none !important;
	color: var(--text-secondary) !important;
	padding: 0.5rem 1rem !important;
	margin: 0 0.25rem !important;
	border-radius: 8px !important;
	transition: all 0.3s ease !important;
}

.dataTables_paginate .paginate_button:hover {
	background: var(--primary-gradient) !important;
	color: white !important;
	transform: translateY(-1px);
}

.dataTables_paginate .paginate_button.current {
	background: var(--primary-gradient) !important;
	color: white !important;
}

.loading-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
	margin-left: 0.5rem;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.fade-in {
	animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
	.hero-title {
		font-size: 2.5rem;
	}

	.upload-section,
	.charts-section,
	.stats-overview {
		padding: 2rem 1.5rem;
	}

	.chart-container {
		height: 300px;
	}

	.main-container {
		padding: 1rem;
	}

	.stat-number {
		font-size: 2rem;
	}
}

/* Custom scrollbar */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: #f1f5f9;
	border-radius: 4px;
}

::-webkit-scrollbar-thumb {
	background: var(--primary-gradient);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--secondary-gradient);
}

/* Chart-specific styles */
.small-chart {
	height: 280px !important;
}

.large-chart {
	height: 400px !important;
}

/* Modal */
.modal-xl {
  max-width: 90%;
}

.detail-section {
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  background: #f8fafc;
}

.detail-title {
  font-weight: 600;
  color: #334155;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.detail-title i {
  margin-right: 0.5rem;
}

.detail-content {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-content:empty::before {
  content: 'No data available';
  color: #64748b;
  font-style: italic;
}

.modal-cell-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  height: 100%;
}

.modal-cell-content:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
}

.truncated-text {
  font-size: 0.875rem;
  color: #64748b;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #f8fafc;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  flex: 1 1 auto; 
  margin-bottom: 0.5rem;
}

.view-details-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 0.875rem;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.modal-cell-content:hover .truncated-text {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
}

.modal-cell-content:hover .view-details-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.view-details-btn:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-xl {
    max-width: 95%;
  }
  
  .detail-section {
    padding: 1rem;
  }
  
  .detail-content {
    font-size: 0.8rem;
    max-height: 200px;
  }
}

