@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Share+Tech+Mono&display=swap');

:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-green: #0aff0a;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
}

body {
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    perspective: 1000px;
}

/* Glass Panel */
header,
.controls-top,
.footswitch {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 16px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-bottom: 30px;
    transform: translateZ(0);
    transition: transform 0.3s;
}

header:hover {
    transform: translateY(-2px);
}

h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(188, 19, 254, 0.3);
}

/* Buttons */
button {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

button:active {
    transform: scale(0.95);
}

#btnLoad {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    min-width: 200px;
    /* Evitar que cambie tamaño */
}

#btnLoad:hover {
    background: var(--neon-purple);
    color: white;
    box-shadow: 0 0 15px var(--neon-purple);
}

/* Loading Spinner State */
#btnLoad.loading {
    pointer-events: none;
    opacity: 0.8;
}

#btnLoad.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    transition: opacity 0.5s;
}

/* Controls Top */
.controls-top {
    display: flex;
    justify-content: space-between;
    /* Distribuye espacio: Load a la izq, Guitar centrado?, Nav a la der? */
    align-items: center;
    padding: 20px;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

/* Selects & Inputs */
select,
input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--neon-blue);
    padding: 10px;
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

select:focus,
input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

option {
    background-color: #0f0c29;
    /* Dark background for dropdown options */
    color: white;
}

/* Options Grid */
.fs-dynamic-content {
    min-height: 110px;
    /* Altura suficiente para el grid de 2 filas o el select */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fs-options-preset {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: left;
}

label {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 8px;
}

/* Bank Selector mejorado para tablets */
.bank-selector {
    display: flex;
    flex-wrap: wrap;
    /* Permitir que baje si no cabe */
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bank-actions {
    display: flex;
    gap: 10px;
    margin-left: 10px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* En pantallas pequeñas, actions baja y quita borde izq */
@media (max-width: 600px) {
    .bank-actions {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 10px;
    }
}

.btn-mini-action {
    width: 40px;
    /* Un poco más grande para el icono */
    height: 40px;
    padding: 8px;
    /* Padding interno */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-mini-action svg {
    width: 100%;
    height: 100%;
}

.btn-mini-action:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 15px var(--neon-green);
    transform: rotate(90deg);
    /* Efecto giratorio para el plus */
}

.btn-mini-action.btn-danger {
    border-color: #ff3333;
    color: #ff3333;
    background: rgba(255, 51, 51, 0.05);
}

.btn-mini-action.btn-danger:hover {
    background: #ff3333;
    color: white;
    box-shadow: 0 0 10px #ff3333;
    transform: rotate(0deg);
    /* El trash no gira */
}

#txtCurrentBank {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: var(--neon-green);
    min-width: 80px;
    text-align: center;
}

.valeton-helper {
    font-size: 0.8rem;
    color: var(--neon-purple);
    margin-top: 5px;
    text-align: right;
    font-weight: bold;
    grid-column: span 2;
    /* Ocupar toda la fila en el grid */
}

/* Pedalboard Grid */
.pedalboard {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: stretch;
    /* Cards misma altura */
}

.footswitch {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    height: 100%;
    /* Llenar altura del flex item */
}

.footswitch:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
}

.fs-header {
    text-align: center;
    font-weight: 300;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

/* LCD Screen Effect for Names */
.fs-name {
    background: #000;
    color: var(--neon-blue);
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.5rem;
    text-align: center;
    border: 2px solid #333;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.2);
    text-transform: uppercase;
    width: 100%;
    margin: 5px 0;
}

.fs-name:focus {
    border-color: var(--neon-blue);
    box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.4), 0 0 10px var(--neon-blue);
}

/* Type Toggle */
.fs-type {
    width: 100%;
    text-align-last: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}

.btn-save-slot {
    margin-top: auto;
    background: linear-gradient(90deg, #0ba360, #3cba92);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(60, 186, 146, 0.3);
}

.btn-save-slot:hover {
    background: linear-gradient(90deg, #0ba360, #3cba92);
    /* Keep gradient */
    box-shadow: 0 0 20px rgba(60, 186, 146, 0.6);
    transform: scale(1.02);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footswitch {
    animation: fadeIn 0.6s ease-out forwards;
}

.footswitch:nth-child(2) {
    animation-delay: 0.1s;
}

.footswitch:nth-child(3) {
    animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .pedalboard {
        flex-direction: column;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .controls-top {
        flex-direction: column;
        gap: 15px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid var(--neon-green);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-color: #ff3333;
    color: #ffd6d6;
}

.toast-icon {
    font-size: 1.2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid var(--neon-blue);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-box h2 {
    margin-top: 0;
    color: var(--neon-blue);
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-mode {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    text-transform: none;
    /* Override general button */
}

.btn-mode:hover {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    transform: translateY(-2px);
}

.btn-mode:hover .mode-text {
    color: #000;
}

.btn-mode:hover .mode-desc {
    color: #333;
}

.mode-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.mode-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    color: white;
}

.mode-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.mode-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.btn-text {
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 8px 20px;
}

.btn-text:hover {
    background: transparent;
    color: white;
    box-shadow: none;
    text-decoration: underline;
}

/* Global Settings Styles */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 16px;
    max-width: 900px;
    /* Same as container max */
    width: 100%;
    box-sizing: border-box;
}

.global-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.global-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gc-header {
    font-weight: bold;
    color: var(--neon-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-row label {
    flex: 1;
}

.input-row input,
.input-row select {
    flex: 2;
}

.gc-options-preset {
    display: flex;
    gap: 5px;
}

.btn-save-global {
    margin-top: 10px;
    background: rgba(188, 19, 254, 0.2);
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-save-global:hover {
    background: var(--neon-purple);
    color: white;
}

@media (max-width: 768px) {
    .global-grid {
        grid-template-columns: 1fr;
    }
}