:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --background-color: #f5f7fa;
    --card-color: #ffffff;
    --text-color: #333333;
    --light-text: #7f8c8d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 70px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.app-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.search-container {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 1rem;
    padding: 1.5rem;
}

.search-box {
    display: flex;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1rem;
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: var(--secondary-color);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn {
    background-color: #ecf0f1;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.radio-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.radio-card {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    padding-bottom: 40px; /* Espacio para el visualizador */
}

.radio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.radio-logo {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.radio-info {
    flex: 1;
}

.radio-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.radio-details {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.radio-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.play-btn, .add-favorite-btn, .remove-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.play-btn:hover, .add-favorite-btn:hover {
    background-color: var(--secondary-color);
}

.add-favorite-btn.active {
    background-color: var(--accent-color);
}

.remove-btn {
    background-color: var(--accent-color);
}

.remove-btn:hover {
    background-color: #c0392b;
}

.nav-tabs {
    display: flex;
    background-color: var(--card-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
    margin: 1rem 1rem 0;
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background-color: var(--card-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.nav-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s;
    transform: translateY(100%);
}

.player-container.active {
    transform: translateY(0);
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.player-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-name {
    font-weight: bold;
}

.player-controls {
    display: flex;
    gap: 1rem;
}

.player-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--light-text);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.sortable-list {
    list-style: none;
    padding: 0;
    margin: 1rem;
}

.sortable-item {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    cursor: grab;
}

.sortable-item.dragging {
    opacity: 0.5;
    background-color: #f8f9fa;
}

.sortable-handle {
    margin-right: 1rem;
    color: var(--light-text);
}

.manage-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.manage-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.default-logo {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    font-size: 2rem;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Responsive */
@media (max-width: 768px) {
    .radio-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 480px) {
    .radio-list {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-btn {
        flex: 0 0 auto;
    }
}

/* Estilo para visualizadores */
.simple-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: none; /* Inicialmente oculto */
    justify-content: space-evenly;
    align-items: flex-end;
    padding: 0 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    z-index: 5;
}

.simple-bar {
    width: 10%;
    height: 30%;
    background-color: #3498db;
    border-radius: 2px 2px 0 0;
    transition: height 0.2s ease, background-color 0.2s ease;
}

/* Emisora activa */
.radio-card.playing .simple-visualizer {
    display: flex;
}

.radio-card.playing {
    border: 2px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.modal h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.form-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
}

.form-actions button[type="button"] {
    background-color: #e0e0e0;
    color: var(--text-color);
}

.form-actions button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
}

/* Componentes adicionales */
.favorites-header {
    background-color: var(--card-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow);
    margin: 0 1rem 1rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorites-selector {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    font-size: 1rem;
    flex-grow: 1;
    margin-right: 1rem;
}

.favorites-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: var(--secondary-color);
}

#delete-list-btn {
    background-color: var(--accent-color);
}

#delete-list-btn:hover {
    background-color: #c0392b;
}

.share-import-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.share-btn, .import-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.share-btn:hover, .import-btn:hover {
    background-color: var(--secondary-color);
}

.share-btn {
    background-color: #2ecc71; /* Verde */
}

.share-btn:hover {
    background-color: #27ae60;
}

/* Tooltip para botones */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: #333;
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
}

/* Controles de visualización */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem;
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}


.control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    flex-grow: 1;
    max-width: 40px;
}

.control-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.control-btn.active {
    background-color: var(--accent-color);
}

.control-select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
}

/* Separador */
.control-separator {
    width: 1px;
    height: 24px;
    background-color: #ddd;
    margin: 0 0.5rem;
}

.control-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.edit-btn-station {
    position: absolute;
    top: 0.5rem;
    right: 3rem; /* Ubicar a la derecha, pero dejando espacio para el botón de borrar */
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}

.edit-btn-station:hover {
    background-color: var(--secondary-color);
}

/* Botón de borrar en las tarjetas */
.delete-btn-station {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}

.delete-btn-station:hover {
    background-color: #c0392b;
}

/* Vistas alternativas */
body.grid-view .radio-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

body.list-view .radio-list {
    display: flex;
    flex-direction: column;
}

body.list-view .radio-card {
    flex-direction: row;
    align-items: center;
    height: 80px;
    padding: 0.5rem 1rem;
}

body.list-view .radio-card .radio-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    margin-right: 1rem;
}

body.list-view .radio-card .radio-info {
    flex: 1;
}

body.list-view .radio-card .radio-actions {
    margin-left: 1rem;
}

/* Modo edición */
body.edit-mode .radio-card {
    position: relative;
}

body.edit-mode .radio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    pointer-events: none;
}

.radio-card .edit-controls {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

.radio-card.edit-mode .edit-controls {
    display: flex;
    gap: 0.5rem;
}

.edit-controls .edit-btn,
.edit-controls .delete-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
}

.edit-controls .edit-btn {
    background-color: var(--primary-color);
}

.edit-controls .delete-btn {
    background-color: var(--accent-color);
}

/* Volumen */
.volume-control {
    display: flex;
    align-items: center;
    margin-right: 1rem;
    color: var(--light-text);
}

#volume-slider {
    margin: 0 0.5rem;
    width: 80px;
}