@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
	--bg-dark: #090d16;
	--card-bg: rgba(17, 24, 39, 0.85);
	--card-border: rgba(255, 255, 255, 0.08);
	--primary-neon: #06b6d4;      /* Cyan brillante */
	--secondary-neon: #ef4444;    /* Rojo Taekwon-Do */
	--text-main: #f3f4f6;
	--text-muted: #9ca3af;
	--font-family: 'Poppins', sans-serif;
	--glow-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: var(--font-family);
}

body {
	background-color: var(--bg-dark);
	background-image: 
		radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
		radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.06) 0%, transparent 45%);
	background-attachment: fixed;
	color: var(--text-main);
	font-size: 14px;
	line-height: 1.6;
	padding: 12px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); }
::-webkit-scrollbar-thumb { background: var(--primary-neon); border-radius: 3px; }

a {
	color: var(--primary-neon);
	text-decoration: none;
	transition: all 0.2s ease;
}
a:hover {
	color: #38bdf8;
	text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

#page {
	width: 100%;
	max-width: 920px;
	margin: 0 auto;
	background: transparent;
	padding: 0;
}

/* Header & Logo */
#logo {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 10px 16px;
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 12px;
	margin-bottom: 16px;
	backdrop-filter: blur(12px);
}

.logo-link {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}

.station-logo-img {
	max-height: 48px;
	width: auto;
	filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.3));
}

.station-title-text {
	font-size: 1.3rem;
	font-weight: 800;
	letter-spacing: 1px;
	color: #fff;
	text-transform: uppercase;
}

#listener_count {
	font-size: 0.85rem;
	background: rgba(6, 182, 212, 0.12);
	border: 1px solid rgba(6, 182, 212, 0.3);
	color: var(--primary-neon);
	padding: 6px 14px;
	border-radius: 20px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
#listener_count span {
	color: #fff;
	font-weight: 800;
}

/* Nav Menu */
#navigation {
	margin-bottom: 16px;
}

.nav-card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 12px;
	padding: 12px 16px;
}

.nav-title {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-items {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.nav-btn {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--card-border);
	color: var(--text-main);
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 0.88rem;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s ease;
}
.nav-btn:hover {
	background: rgba(6, 182, 212, 0.15);
	border-color: var(--primary-neon);
	color: #fff;
	transform: translateY(-2px);
}

/* Section Cards */
.section-card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 14px;
	padding: 18px 22px;
	margin-bottom: 18px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(12px);
}

.card-head-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid var(--card-border);
	padding-bottom: 12px;
	margin-bottom: 16px;
}

.neon-icon {
	color: var(--primary-neon);
	font-size: 1.25rem;
	filter: drop-shadow(0 0 6px var(--primary-neon));
}

.live-duration {
	margin-left: auto;
	font-size: 0.82rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--card-border);
	color: var(--primary-neon);
	padding: 4px 10px;
	border-radius: 12px;
	font-weight: 600;
}

/* Currently Playing Track */
.current-track-flex {
	display: flex;
	gap: 20px;
	align-items: center;
}

.cover-art-container {
	flex-shrink: 0;
}

.main-cover {
	width: 110px;
	height: 110px;
	border-radius: 10px;
	object-fit: cover;
	border: 2px solid rgba(6, 182, 212, 0.4);
	box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.no-cover {
	width: 110px;
	height: 110px;
	border-radius: 10px;
	background: linear-gradient(135deg, #1e293b, #0f172a);
	border: 1px solid var(--card-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
	color: var(--primary-neon);
}

.track-details {
	flex-grow: 1;
}

.track-title {
	font-size: 1.35rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.track-artist {
	font-size: 1.05rem;
	color: var(--primary-neon);
	font-weight: 600;
	margin-bottom: 2px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.track-album {
	font-size: 0.9rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
}

.badge-requested {
	background: linear-gradient(135deg, #ef4444, #b91c1c);
	color: #fff;
	font-size: 0.75rem;
	padding: 3px 10px;
	border-radius: 20px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.badge-requested-mini {
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #ef4444;
	font-size: 0.7rem;
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: 600;
	margin-left: 6px;
}

.dedication-box {
	background: rgba(6, 182, 212, 0.08);
	border-left: 3px solid var(--primary-neon);
	padding: 8px 12px;
	border-radius: 0 8px 8px 0;
	font-size: 0.88rem;
	margin-top: 8px;
	color: #e2e8f0;
}
.dedication-quote {
	font-style: italic;
	color: var(--text-muted);
	margin-top: 4px;
}

.track-actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
}

.action-pill {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--card-border);
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 0.8rem;
	color: var(--text-muted);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.action-pill:hover {
	border-color: var(--primary-neon);
	color: var(--primary-neon);
}

/* Coming Up */
.coming-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
}

.coming-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--card-border);
	padding: 10px 14px;
	border-radius: 10px;
	transition: all 0.2s ease;
}
.coming-item:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(6, 182, 212, 0.3);
}

.coming-num {
	width: 26px;
	height: 26px;
	background: var(--primary-neon);
	color: #090d16;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 0.82rem;
	flex-shrink: 0;
}

.coming-meta {
	flex-grow: 1;
	min-width: 0;
}
.coming-song-link {
	display: block;
	color: var(--text-main);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.coming-artist {
	display: block;
	font-size: 0.8rem;
	color: var(--text-muted);
}

/* Modern Tables (History / Playlist) */
.history-table-wrapper {
	overflow-x: auto;
	width: 100%;
}

.modern-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.modern-table th {
	background: rgba(15, 23, 42, 0.7);
	color: var(--text-muted);
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--card-border);
}

.modern-table td {
	padding: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
	vertical-align: middle;
	font-size: 0.9rem;
}

.modern-table tr:hover td {
	background: rgba(6, 182, 212, 0.04);
}

.history-icon {
	color: var(--primary-neon);
	text-align: center;
}

.history-title {
	font-weight: 600;
	color: #fff;
}

.history-artist {
	font-size: 0.82rem;
	color: var(--text-muted);
}

.history-album {
	font-size: 0.85rem;
	color: var(--text-muted);
}

.history-time {
	font-weight: 600;
	color: var(--primary-neon);
	font-size: 0.85rem;
}

.icon-btn {
	color: var(--text-muted);
	font-size: 1.1rem;
	padding: 4px;
	transition: color 0.2s;
}
.icon-btn:hover {
	color: var(--primary-neon);
}

/* Playlist / Search */
.search-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.search-input-group {
	display: flex;
	gap: 10px;
}

.modern-input {
	flex-grow: 1;
	background: rgba(15, 23, 42, 0.8);
	border: 1px solid var(--card-border);
	border-radius: 8px;
	color: #fff;
	padding: 10px 14px;
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s;
}
.modern-input:focus {
	border-color: var(--primary-neon);
	box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.btn-neon {
	background: linear-gradient(135deg, #06b6d4, #0284c7);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 10px 20px;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s ease;
	box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}
.btn-neon:hover {
	background: linear-gradient(135deg, #0891b2, #0369a1);
	transform: translateY(-2px);
	box-shadow: 0 0 18px rgba(6, 182, 212, 0.5);
}

.filter-letters-container {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.filter-label {
	font-size: 0.82rem;
	color: var(--text-muted);
	font-weight: 600;
}

.letters-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.char-btn {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--card-border);
	color: var(--text-main);
	padding: 4px 9px;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
}
.char-btn:hover, .char-btn.active {
	background: var(--primary-neon);
	color: #090d16;
	border-color: var(--primary-neon);
	font-weight: 800;
}

.btn-request-mini {
	background: linear-gradient(135deg, #ef4444, #dc2626);
	color: #fff !important;
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
.btn-request-mini:hover {
	transform: scale(1.05);
	box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
}

.song-num {
	font-weight: 700;
	color: var(--text-muted);
	font-size: 0.85rem;
}

.paging-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 6px;
	font-size: 0.85rem;
	color: var(--text-muted);
}
.paging-bar a {
	font-weight: 700;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--card-border);
	padding: 4px 12px;
	border-radius: 6px;
}

/* Top Requests */
.top-req-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.top-req-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.02);
	color: var(--text-main);
}
.top-req-item:hover {
	background: rgba(6, 182, 212, 0.08);
}
.top-rank {
	font-weight: 800;
	color: var(--primary-neon);
	width: 18px;
	font-size: 0.85rem;
}
.top-info {
	flex-grow: 1;
	min-width: 0;
	line-height: 1.2;
}
.top-song {
	display: block;
	font-size: 0.82rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.top-artist {
	font-size: 0.72rem;
	color: var(--text-muted);
}
.top-badge {
	background: rgba(239, 68, 68, 0.2);
	color: #ef4444;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 10px;
}

/* Request Success / Modal */
.success-banner {
	background: rgba(16, 185, 129, 0.12);
	border: 1px solid rgba(16, 185, 129, 0.3);
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	color: #fff;
}
.success-banner h2 {
	font-size: 1.25rem;
	font-weight: 700;
	color: #34d399;
	margin-bottom: 4px;
}
.success-banner p {
	color: #d1fae5;
	font-size: 0.9rem;
}

/* Footer */
#footer {
	text-align: center;
	padding: 16px;
	color: var(--text-muted);
	font-size: 0.78rem;
	border-top: 1px solid var(--card-border);
	margin-top: 20px;
}

/* Responsive Mobile & Table Enhancements */
@media (max-width: 650px) {
	body {
		padding: 4px;
	}

	#page {
		padding: 0;
	}

	.section-card {
		padding: 12px;
		border-radius: 12px;
	}

	/* Barra de búsqueda apilada en móvil */
	.search-input-group {
		flex-direction: column;
		gap: 8px;
	}

	.btn-neon {
		width: 100%;
		justify-content: center;
		padding: 12px;
	}

	/* Carrusel horizontal táctil para las letras */
	.letters-grid {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 8px;
		gap: 6px;
	}

	.letters-grid::-webkit-scrollbar {
		height: 4px;
	}
	.letters-grid::-webkit-scrollbar-thumb {
		background: var(--primary-neon);
		border-radius: 4px;
	}

	.char-btn {
		flex-shrink: 0;
		padding: 6px 12px;
		font-size: 0.85rem;
	}

	/* Convertir la tabla en formato Tarjeta para que no haya scroll horizontal en el celular */
	.history-table-wrapper {
		overflow-x: visible;
	}

	.modern-table, 
	.modern-table thead, 
	.modern-table tbody, 
	.modern-table th, 
	.modern-table td, 
	.modern-table tr {
		display: block;
	}

	.modern-table thead tr {
		position: absolute;
		top: -9999px;
		left: -9999px;
	}

	.modern-table tr {
		background: rgba(15, 23, 42, 0.7);
		border: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 12px;
		margin-bottom: 12px;
		padding: 12px 14px;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.modern-table td {
		padding: 0;
		border: none;
		text-align: left !important;
	}

	.modern-table td.song-num {
		display: none; /* Ocultar el número en móvil para ahorrar espacio */
	}

	.modern-table td:nth-child(2) {
		/* Título y artista */
		margin-bottom: 2px;
	}

	.history-title {
		font-size: 1rem;
		font-weight: 700;
		color: #ffffff;
		line-height: 1.3;
	}

	.history-artist {
		font-size: 0.88rem;
		color: #38bdf8;
		font-weight: 600;
		margin-top: 2px;
	}

	.history-album {
		font-size: 0.8rem;
		color: #94a3b8;
	}

	/* Fila inferior de cada tarjeta: Duración a la izquierda y Botón Pedir grande a la derecha */
	.modern-table td:nth-child(4) {
		margin-top: 6px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.btn-request-mini {
		padding: 8px 18px;
		font-size: 0.88rem;
		border-radius: 8px;
		width: 100%;
		justify-content: center;
	}

	.modern-table td.history-time {
		display: none; /* La duración no es crítica en móvil */
	}

	.current-track-flex {
		flex-direction: column;
		text-align: center;
	}
	.track-title, .track-artist, .track-album {
		justify-content: center;
	}
	.track-actions {
		justify-content: center;
	}
	#logo {
		justify-content: center;
		text-align: center;
	}
}
