/* 
 * AESTHETIC: LUMINOUS GLASS (Option 3) 
 * Vibe: Deep Ocean Bioluminescence, Premium, Ethereal
 */

:root {
	/* Color Palette - Deep Ocean / Aurora */
	--kt-glass-bg-dark: #0f172a;
	/* Deep Navy */
	--kt-glass-bg-light: #1e293b;
	/* Lighter Navy */

	--kt-accent-cyan: #06b6d4;
	/* Electric Cyan */
	--kt-accent-purple: #8b5cf6;
	/* Vivid Purple */
	--kt-accent-emerald: #10b981;
	/* Neon Emerald */
	--kt-accent-rose: #f43f5e;
	/* Hot Rose (for delete/danger) */

	/* Functional */
	--kt-text-primary: #f8fafc;
	--kt-text-secondary: #94a3b8;
	--kt-text-muted: #64748b;

	/* Glass Layering */
	--kt-glass-panel-bg: rgba(30, 41, 59, 0.4);
	/* Low opacity dark blue */
	--kt-glass-border: rgba(255, 255, 255, 0.08);
	--kt-glass-shine: rgba(255, 255, 255, 0.03);
	--kt-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

	/* Typography */
	--kt-font-family: 'Outfit', sans-serif;

	/* Animation */
	--kt-ease-swoop: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Reset & Layout */
.kt-wrapper {
	font-family: var(--kt-font-family);
	color: var(--kt-text-primary);
	background: radial-gradient(circle at 10% 20%, #0f172a 0%, #172554 90%);
	/* We will use a pseudo element for the 'aurora' effect */
	position: relative;
	padding: 3rem;
	border-radius: 24px;
	max-width: 1100px;
	margin: 2rem auto;
	overflow: hidden;
	box-shadow:
		0 20px 50px rgba(0, 0, 0, 0.5),
		0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* The Aurora Gradient Background Animation */
.kt-wrapper::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background:
		radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.15), transparent 60%),
		radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15), transparent 50%);
	z-index: 0;
	animation: kt-aurora-spin 20s linear infinite;
	pointer-events: none;
}

@keyframes kt-aurora-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.kt-wrapper * {
	box-sizing: border-box;
	position: relative;
	/* Ensure content sits above aurora */
	z-index: 1;
}

/* Header */
.kt-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 3rem;
}

.kt-header__title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0;
	background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	letter-spacing: -0.03em;
}

/* Glass Panels */
.kt-panel {
	background: var(--kt-glass-panel-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--kt-glass-border);
	border-radius: 20px;
	padding: 2rem;
	box-shadow: var(--kt-glass-shadow);
	margin-bottom: 2rem;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kt-panel:hover {
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
	border-color: rgba(255, 255, 255, 0.15);
}

.kt-panel__title {
	font-size: 1.1rem;
	color: var(--kt-accent-cyan);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 600;
	margin: 0 0 1.5rem 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Forms & Inputs - The "pill" aesthetic */
.kt-input,
.kt-select,
.kt-textarea,
.kt-btn {
	appearance: none;
	border: none;
	outline: none;
	font-family: var(--kt-font-family);
	font-size: 0.95rem;
}

.kt-input,
.kt-select,
.kt-textarea {
	width: 100%;
	background: rgba(15, 23, 42, 0.6);
	border: 1px solid var(--kt-glass-border);
	border-radius: 12px;
	padding: 1rem 1.25rem;
	color: #fff;
	transition: all 0.2s ease;
}

.kt-input:focus,
.kt-select:focus,
.kt-textarea:focus {
	background: rgba(15, 23, 42, 0.8);
	border-color: var(--kt-accent-cyan);
	box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.kt-input::placeholder {
	color: var(--kt-text-muted);
}

/* Buttons - Glowing & Floating */
.kt-btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	padding: 0.8rem 1.8rem;
	border-radius: 50px;
	/* Full pill */
	font-weight: 600;
	cursor: pointer;
	background: linear-gradient(135deg, var(--kt-accent-cyan) 0%, #0891b2 100%);
	color: #fff;
	box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
	transition: transform 0.2s var(--kt-ease-swoop), box-shadow 0.2s ease;
}

.kt-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
	background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
}

.kt-btn:active {
	transform: translateY(0);
}

.kt-btn--secondary {
	background: rgba(255, 255, 255, 0.05);
	color: var(--kt-text-secondary);
	box-shadow: none;
	border: 1px solid var(--kt-glass-border);
}

.kt-btn--secondary:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--kt-text-primary);
	box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.2);
}

.kt-btn--small {
	padding: 0.5rem 1.2rem;
	font-size: 0.85rem;
}

/* Grid System */
.kt-form-row {
	display: grid;
	grid-template-columns: 2fr 1fr 2fr;
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.kt-form-group {
	margin-bottom: 0;
}

/* Dropdowns & Results */
.kt-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	width: 100%;
	background: #1e293b;
	border: 1px solid var(--kt-glass-border);
	border-radius: 12px;
	z-index: 100;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
	max-height: 200px;
	overflow-y: auto;
}

.kt-dropdown.hidden {
	display: none;
}

.kt-dropdown__item {
	padding: 0.8rem 1.2rem;
	color: var(--kt-text-secondary);
	cursor: pointer;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kt-dropdown__item:hover {
	background: rgba(6, 182, 212, 0.1);
	color: var(--kt-accent-cyan);
}

/* The Table - The "Command Center" Display */
.kt-table-wrapper {
	margin: 0;
	border-radius: 16px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid var(--kt-glass-border);
}

.kt-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	color: var(--kt-text-primary);
}

.kt-table th {
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	padding: 1.2rem 1.5rem;
	color: var(--kt-text-muted);
	font-weight: 600;
	text-align: left;
	background: rgba(15, 23, 42, 0.4);
	border-bottom: 1px solid var(--kt-glass-border);
}

.kt-table td {
	padding: 1.5rem 1.5rem;
	border-bottom: 1px solid var(--kt-glass-border);
	font-size: 0.95rem;
	vertical-align: middle;
	transition: background 0.2s;
}

.kt-table tr:last-child td {
	border-bottom: none;
}

.kt-table tr:hover td {
	background: rgba(255, 255, 255, 0.02);
}

.kt-keyword-text {
	font-size: 1.1rem;
	color: #fff;
	font-weight: 500;
}

/* Rank Badges */
.kt-rank-badge {
	display: inline-block;
	padding: 0.3em 0.8em;
	border-radius: 6px;
	font-weight: 700;
	/* Default styling is overwritten by JS inline styles, 
       but we will use CSS classes preferably if we can refactor logic later */
}

/* Console / Terminal */
.kt-panel--console {
	background: #0f172a;
	border: 1px solid rgba(255, 255, 255, 0.1);
	font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.kt-console {
	color: var(--kt-accent-emerald);
	opacity: 0.8;
}

.kt-console__line {
	margin-bottom: 4px;
}

.kt-console__line--info {
	color: #94a3b8;
}

.kt-console__line--success {
	color: var(--kt-accent-emerald);
}

.kt-console__line--error {
	color: var(--kt-accent-rose);
}


/* Delete Button Specifics */
.kt-delete-btn {
	color: var(--kt-text-muted);
	opacity: 0.6;
	transition: all 0.2s;
}

.kt-delete-btn:hover {
	color: var(--kt-accent-rose) !important;
	background: rgba(244, 63, 94, 0.1) !important;
	opacity: 1;
}

/* Progress Bar */
.kt-progress-track {
	width: 100%;
	height: 8px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kt-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--kt-accent-cyan), var(--kt-accent-purple));
	box-shadow: 0 0 15px var(--kt-accent-cyan);
	transition: width 0.3s ease;
	border-radius: 4px;
}

/* Utility */
.kt-label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--kt-text-muted);
	font-weight: 600;
}

/* Input Group manual flex fix for the search button */
/* Input Group manual flex fix for the search button */
.kt-input-group {
	display: flex;
	gap: 0.8rem;
}

/* -------------------------------------------------------------------------- */
/* MICRO-ENGAGEMENTS & ANIMATIONS                                             */
/* -------------------------------------------------------------------------- */

/* 1. Staggered Entry Animation */
@keyframes kt-fade-in-up {
	0% {
		opacity: 0;
		transform: translateY(20px);
		filter: blur(5px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
		filter: blur(0);
	}
}

.kt-panel {
	animation: kt-fade-in-up 0.6s var(--kt-ease-swoop) forwards;
	opacity: 0;
	/* Init hidden */
	animation-delay: 0.1s;
}

/* Stagger delays for panels if multiple */
.kt-panel:nth-child(1) {
	animation-delay: 0.1s;
}

.kt-panel:nth-child(2) {
	animation-delay: 0.2s;
}

.kt-panel:nth-child(3) {
	animation-delay: 0.3s;
}


/* 2. Button Shimmer & Pulse */
@keyframes kt-shimmer {
	0% {
		transform: translateX(-150%) skewX(-15deg);
	}

	100% {
		transform: translateX(150%) skewX(-15deg);
	}
}

.kt-btn {
	position: relative;
	overflow: hidden;
}

/* Add shimmer only on hover or specific state */
.kt-btn:hover::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 60%;
	height: 100%;
	background: linear-gradient(to right,
			rgba(255, 255, 255, 0) 0%,
			rgba(255, 255, 255, 0.2) 50%,
			rgba(255, 255, 255, 0) 100%);
	transform: skewX(-15deg);
	animation: kt-shimmer 1s infinite;
}

/* Active State Pulse */
@keyframes kt-pulse-glow {
	0% {
		box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
	}

	70% {
		box-shadow: 0 0 0 10px rgba(6, 182, 212, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
	}
}

.kt-btn[disabled] {
	opacity: 0.7;
	cursor: not-allowed;
	background: var(--kt-glass-bg-light);
	color: var(--kt-text-muted);
	animation: none;
	box-shadow: none;
}

.kt-btn.kt-working {
	animation: kt-pulse-glow 2s infinite;
}


/* 3. Input Interactions */
.kt-input:focus,
.kt-select:focus,
.kt-textarea:focus {
	transform: scale(1.01);
}


/* 4. Table Row Interaction */
.kt-table tr {
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.kt-table tr:hover {
	transform: translateX(4px);
	/* Subtle slide right */
	background: rgba(255, 255, 255, 0.03) !important;
	border-left: 2px solid var(--kt-accent-cyan);
}

.kt-table td {
	border-left: 2px solid transparent;
	/* Prepare for border transition */
	transition: border-color 0.2s ease;
}


/* 5. Ripple Effect (JS Triggered) */
.kt-ripple {
	position: absolute;
	border-radius: 50%;
	transform: scale(0);
	animation: kt-ripple-anim 0.6s linear;
	background-color: rgba(255, 255, 255, 0.3);
	pointer-events: none;
}

@keyframes kt-ripple-anim {
	to {
		transform: scale(4);
		opacity: 0;
	}
}

/* 6. Custom Scrollbar */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--kt-glass-bg-dark);
}

::-webkit-scrollbar-thumb {
	background: #334155;
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--kt-accent-cyan);
}

/* 7. Tooltip (Pure CSS) */
[data-tooltip] {
	position: relative;
	cursor: help;
}

[data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-5px);
	background: var(--kt-glass-bg-dark);
	color: #fff;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 0.75rem;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
	border: 1px solid var(--kt-glass-border);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	z-index: 1000;
}

[data-tooltip]:hover::before {
	opacity: 1;
	transform: translateX(-50%) translateY(-10px);
}
/* Stats Grid & Cards */
.kt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kt-stat-card {
    background: var(--kt-glass-panel-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--kt-glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.kt-stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.6);
}

.kt-stat-card__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--kt-text-secondary);
    margin-bottom: 0.5rem;
}

.kt-stat-card__value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Alert List Styles */
.kt-alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.kt-alert-item {
    background: rgba(15, 23, 42, 0.5);
    border-left: 4px solid var(--kt-text-muted);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.kt-alert-item:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateX(5px);
}

.kt-alert--critical {
    border-left-color: var(--kt-accent-rose);
    background: rgba(244, 63, 94, 0.05);
}

.kt-alert--warning {
    border-left-color: #f59e0b; /* Amber */
    background: rgba(245, 158, 11, 0.05);
}

.kt-alert--opportunity {
    border-left-color: var(--kt-accent-emerald);
    background: rgba(16, 185, 129, 0.05);
}

.kt-alert__icon {
    font-size: 1.5rem;
}

.kt-alert__content {
    flex: 1;
}

.kt-alert__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 2px;
}

.kt-alert__meta {
    font-size: 0.8rem;
    color: var(--kt-text-muted);
}
