/* Radio Plugin - Estilos Principales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Previene scroll horizontal */
}

.container {
    width: 100%;
    max-width: 90vw;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #212121;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
    text-align: center;
    color: #212121;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.demo-section, .config-section, .code-section, .instructions {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

h3 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="color"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="color"] {
    width: 60px;
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

code {
    font-family: 'Courier New', monospace;
}

.instructions ul, .instructions ol {
    padding-left: 20px;
    margin: 15px 0;
}

.instructions li {
    margin-bottom: 8px;
}

/* Estilos del Reproductor de Radio */
.radio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.radio-player::before {
    content: '';
    position: absolute;
    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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.radio-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    z-index: 2;
    border: 3px solid rgba(255,255,255,0.2);
}

.radio-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.radio-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.radio-status {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.radio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.volume-slider {
    width: 100%;
    max-width: 90%;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: none;
}

.song-title {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 15px;
    position: relative;
    z-index: 2;
    min-height: 20px;
    font-style: italic;
}

/* Grid Layout para dos columnas */
.main-grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    margin-top: 20px;
    overflow: hidden; /* Previene desbordamiento del grid */
}

.config-column {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    min-width: 0;
}

.preview-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Permite que el contenido se contraiga */
    overflow: hidden; /* Previene desbordamiento */
}

/* Estilos específicos para la sección de código */
.code-section {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    max-width: 100%;
    overflow: hidden;
}

.code-section pre {
    max-width: 100%;
    overflow-x: auto;
    word-break: break-all;
    white-space: pre-wrap;
}

.code-section code {
    word-break: break-all;
    white-space: pre-wrap;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .config-column {
        order: 2;
    }
    
    .preview-column {
        order: 1;
    }
}

/* Campos de colores del visualizador - ocultos por defecto */
.visualizer-colors {
    display: none;
    transition: all 0.3s ease;
}

/* Mostrar campos cuando multicolor está activado */
.visualizer-colors.show {
    display: block;
}

/* Sección de instrucciones en la columna derecha */
.instructions-section {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
}

.instructions-section.hidden {
    display: none;
}

.instructions-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.instructions-section h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.instructions-section ol,
.instructions-section ul {
    padding-left: 25px;
    line-height: 1.6;
}

.instructions-section li {
    margin-bottom: 8px;
    color: #555;
}

.instructions-section ul li {
    list-style: none;
    position: relative;
    padding-left: 10px;
}

/* Botón para volver a instrucciones */
#back-to-instructions {
    background: linear-gradient(135deg, #6c7ae0, #7b68ee);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
}

#back-to-instructions:hover {
    transform: translateY(-2px);
}

.loading {
    opacity: 0.6;
}

.error {
    color: #ff6b6b;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .demo-section, .config-section, .code-section, .instructions {
        padding: 20px;
    }
    
    .radio-player {
        padding: 20px;
    }
    
    .volume-control {
        flex-direction: column;
        gap: 5px;
    }
    
    .volume-slider {
        width: 150px;
    }
}

/* Animaciones */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.radio-player.playing .radio-logo {
    animation: pulse 2s infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
