* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --accent-cyan: #00ffff;
    --accent-magenta: #ff00ff;
    --accent-purple: #9d4edd;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d0;
    --text-muted: #6a6a8b;
    --border-glow: rgba(0, 255, 255, 0.2);
    --neon-cyan: 0 0 15px rgba(0, 255, 255, 0.5);
    --neon-magenta: 0 0 15px rgba(255, 0, 255, 0.5);
    --gradient-cyber: linear-gradient(135deg, #00ffff, #ff00ff);
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 10% 20%, #1a1a2e, #0a0a12);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    color: var(--text-primary);
}

.app-container {
    max-width: 700px;
    width: 100%;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.3);
}

/* Header */
.app-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(20, 20, 40, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 48px;
    height: 48px;
    background: var(--gradient-cyber);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: var(--neon-cyan);
    animation: rotate 4s linear infinite;
}

.logo-circle span {
    transform: rotate(-45deg);
}

@keyframes rotate {
    0% { transform: rotate(45deg); }
    100% { transform: rotate(405deg); }
}

.logo h1 {
    font-size: 1.5rem;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.status-dot.recording {
    background: #ff0066;
    box-shadow: 0 0 10px #ff0066;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Language row */
.language-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.language-card:first-child {
    position: relative;
    z-index: 3; /* El primero más alto */
}

.language-card:last-child {
    position: relative;
    z-index: 2; /* El segundo más bajo */
}

.language-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.language-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.language-label i {
    color: var(--accent-cyan);
}

/* Custom Dropdown - VERSIÓN SIMPLE QUE FUNCIONA */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-button {
    width: 100%;
    padding: 14px 16px;
    background: #1a1a2e;
    border: 2px solid #00ffff;
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: #1a1a2e;
    border: 2px solid #00ffff;
    border-radius: 16px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 0 20px #00ffff;
    scrollbar-width: none;  /* OCULTA BARRA EN FIREFOX */
    -ms-overflow-style: none;  /* OCULTA BARRA EN IE */
}

.dropdown-menu::-webkit-scrollbar {
    display: none;  /* OCULTA BARRA EN CHROME/EDGE/SAFARI */
}
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    /* ELIMINA LA LÍNEA DE BORDE INFERIOR */
    border-bottom: none;  /* AÑADE ESTO */
}

.dropdown-item:last-child {
    border-bottom: none;  /* YA ESTÁ, DÉJALO */
}

.dropdown-item:hover {
    background: rgba(0, 255, 255, 0.2);
}

/* Text panels */
.text-panel {
    margin: 0 24px 20px 24px;
    background: rgba(37, 37, 66, 0.7);
    border-radius: 24px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.panel-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--accent-magenta);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
}

.panel-btn:hover {
    background: var(--gradient-cyber);
    color: white;
}

.panel-content {
    min-height: 100px;
    padding: 20px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.panel-content .placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Record button */
.record-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.record-button {
    width: 160px;
    height: 160px;
    border-radius: 40px;
    background: var(--gradient-cyber);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--neon-cyan);
    transition: all 0.3s ease;
}

.record-button.recording {
    animation: recording 1.5s infinite;
}

@keyframes recording {
    0%, 100% { box-shadow: 0 0 20px #ff00ff; }
    50% { box-shadow: 0 0 50px #ff00ff; }
}

.record-button i {
    font-size: 3.5rem;
}

/* Speed control */
.speed-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px 0;
}

.speed-control {
    display: flex;
    gap: 12px;
    background: rgba(37, 37, 66, 0.7);
    padding: 6px;
    border-radius: 40px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.speed-btn {
    width: 60px;
    height: 44px;
    border-radius: 30px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.speed-btn.active {
    background: var(--gradient-cyber);
    color: white;
    box-shadow: var(--neon-cyan);
}

/* Loader */
.loader-container {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loader-container.active {
    display: block;
}

.cyber-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top-color: var(--accent-cyan);
    border-right-color: var(--accent-magenta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Error */
.error-message {
    display: none;
    background: rgba(255, 0, 102, 0.1);
    color: #ff0066;
    padding: 14px 20px;
    margin: 0 24px 20px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 0, 102, 0.3);
    align-items: center;
    gap: 12px;
}

.error-message.active {
    display: flex;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .language-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .record-button {
        width: 140px;
        height: 140px;
    }
    
    .record-button i {
        font-size: 3rem;
    }
    
    .speed-btn {
        width: 52px;
        height: 40px;
    }
}

@media (max-width: 380px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .record-button {
        width: 120px;
        height: 120px;
    }
}