/* ============================================
   PLAYGROUND MK-1 SPECIFIC STYLES
   Only features unique to mk-1 music tool
   ============================================ */

/* === SECTION === */
.section {
    margin-bottom: 3rem;
}

/* === CARD FULL === */
.card-full {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* === CARD TYPOGRAPHY (AGREGADO PARA CONSISTENCIA) === */
.card h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    text-transform: lowercase;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: lowercase;
}

.card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.card p:last-child {
    margin-bottom: 0;
}

/* === SUPPORT CARD === */
.support-card pre {
    background: transparent;
    padding: 2.5rem 1.5rem;
    border-radius: 2px;
    font-size: 0.85rem;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}

.support-card a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.support-card a:hover {
    color: var(--text-secondary);
}

.support-card a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* === GRID LAYOUT === */
.workspace {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.workspace-three-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.module-full { grid-column: span 12; }
.module-half { grid-column: span 6; }
.module-third { 
    grid-column: span 4;
}
.module-twothird { grid-column: span 8; }

/* === LOOP VERTICAL LAYOUT === */
.loop-vertical {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.loop-vertical .btn-group {
    margin-bottom: 1rem;
}

.loop-vertical .loop-mic-btn {
    width: 100%;
    margin-bottom: 1rem;
}

.loop-vertical .loop-info {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
}

.loop-vertical .loop-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.loop-vertical .loop-bottom {
    margin-top: auto;
    padding-top: 1.5rem;
}

/* === VIBE VERTICAL === */
.vibe-vertical {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vibe-container-vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 0;
}

.vibe-circle {
    width: 340px;
    height: 340px;
    max-width: 100%;
    cursor: pointer;
}

/* === FX VERTICAL === */
.fx-vertical {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fx-vertical .control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* === VISUALIZER === */
.visualizer {
    height: 60px;
    background: var(--viz-bg);
    position: relative;
    overflow: hidden;
}

.visualizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.18;
    z-index: 10;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="350" height="350"><filter id="vn"><feTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="7" /></filter><rect width="100%" height="100%" filter="url(%23vn)"/></svg>');
}

canvas {
    width: 100%;
    height: 100%;
}

/* === DRUM PADS === */
.pad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.pad {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="pn"><feTurbulence type="fractalNoise" baseFrequency="1.8" numOctaves="4" /></filter><rect width="100%" height="100%" filter="url(%23pn)"/></svg>');
}

.pad-label {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-normal);
    color: var(--text-tertiary);
    position: relative;
    z-index: 2;
}

.pad-key {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 600;
    z-index: 2;
}

.pad:hover {
    background: var(--hover-primary);
    border-color: var(--border-secondary);
}

.pad.active {
    background: var(--active-bg);
    border-color: var(--active-bg);
}

.pad.active .pad-label {
    color: var(--active-text);
}

.pad.active .pad-key {
    color: var(--text-secondary);
}

/* === KEYBOARD === */
.keyboard {
    display: flex;
    gap: 1px;
    height: 140px;
    background: var(--border-primary);
    padding: 1px;
    position: relative;
}

.key {
    flex: 1;
    background: var(--hover-primary);
    cursor: pointer;
    transition: all 0.05s ease;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
    user-select: none;
    -webkit-user-select: none;
}

.key-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.key.black {
    background: var(--active-bg);
    height: 90px;
    margin: 0 -12px;
    z-index: 2;
    flex: 0.6;
}

.key.black .key-label {
    color: var(--text-tertiary);
}

.key:active, .key.active {
    background: var(--border-primary);
}

.key.black:active, .key.black.active {
    background: var(--hover-secondary);
}

/* === CONTROLS === */
.control-group {
    margin-bottom: 1.5rem;
}

.control-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-normal);
    color: var(--text-tertiary);
}

.control-value {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    width: 100%;
    height: 2px;
    background: var(--border-primary);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--active-bg);
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--active-bg);
    border-radius: 50%;
    border: none;
}

select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
    border-color: var(--border-secondary);
}

/* === SLOT BUTTONS === */
.slot-btn {
    position: relative;
}

.slot-btn.has-content::after {
    content: '';
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 5px;
    height: 5px;
    background: #999;
    border-radius: 50%;
}

.slot-btn.has-content.active::after {
    background: #000;
}

.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

/* === MIC INDICATOR === */
.mic-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.mic-indicator.active {
    background: #ff4444;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* === SEQUENCER === */
.sequencer {
    background: var(--viz-bg);
    padding: 0.8rem;
}

.seq-row {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
}

.seq-row:last-child {
    margin-bottom: 0;
}

.seq-label {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--text-tertiary);
    text-align: right;
    padding-right: 6px;
}

.seq-steps {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
}

.step {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.step:hover {
    background: var(--hover-primary);
}

.step.active {
    background: var(--active-bg);
    border-color: var(--text-primary);
}

.step.playing {
    background: #999;
    border-color: var(--text-tertiary);
}

/* === STATUS BAR === */
.status-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-normal);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.status-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.12;
    z-index: 1;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250"><filter id="sn"><feTurbulence type="fractalNoise" baseFrequency="1.3" numOctaves="5" /></filter><rect width="100%" height="100%" filter="url(%23sn)"/></svg>');
}

.status-item {
    color: var(--text-tertiary);
    position: relative;
    z-index: 2;
}

.status-value {
    color: var(--text-primary);
    margin-left: 0.5rem;
}

/* === SHORTCUTS MODAL === */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.shortcut {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.shortcut-key {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    padding: 0.3rem 0.6rem;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    font-size: 0.7rem;
    text-transform: lowercase;
}

.shortcut-desc {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
}

/* === RESPONSIVE MK-1 === */
@media (max-width: 1024px) {
    .module-half, .module-third, .module-twothird {
        grid-column: span 12;
    }
    
    .workspace-three-cols {
        grid-template-columns: 1fr;
    }
    
    .loop-vertical,
    .vibe-vertical,
    .fx-vertical {
        height: auto;
    }
}

@media (max-width: 768px) {
    .workspace {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .workspace-three-cols {
        gap: 1rem;
    }

    .pad-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }

    .pad-label {
        font-size: 0.65rem;
    }

    .pad-key {
        font-size: 0.6rem;
        top: 0.4rem;
        right: 0.4rem;
    }

    .keyboard {
        height: 100px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .key {
        min-width: 35px;
        padding-bottom: 0.8rem;
    }

    .key.black {
        height: 65px;
        min-width: 25px;
    }

    .key-label {
        font-size: 0.6rem;
    }

    .sequencer {
        padding: 0.6rem;
    }

    .seq-row {
        grid-template-columns: 40px 1fr;
        gap: 4px;
        margin-bottom: 4px;
    }

    .seq-label {
        font-size: 0.55rem;
        padding-right: 4px;
    }

    .seq-steps {
        gap: 1.5px;
    }

    .control-label {
        font-size: 0.65rem;
    }

    .control-group {
        margin-bottom: 1rem;
    }

    .btn-group {
        gap: 0.4rem;
    }

    select {
        font-size: 0.8rem;
        padding: 0.7rem 0.9rem;
    }

    .status-bar {
        padding: 0.8rem 1rem;
        font-size: 0.65rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .status-item {
        flex: 1 1 45%;
    }

    .visualizer {
        height: 50px !important;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pad-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .keyboard {
        height: 90px;
    }

    .key {
        min-width: 30px;
    }

    .key.black {
        height: 60px;
        min-width: 20px;
    }

    .seq-row {
        grid-template-columns: 35px 1fr;
    }

    .seq-label {
        font-size: 0.5rem;
    }

    .status-bar {
        padding: 0.7rem 0.8rem;
        font-size: 0.6rem;
    }

    .module .btn-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .slot-btn {
        font-size: 0.65rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .module-half {
        grid-column: span 6;
    }

    .workspace:first-of-type .module-twothird {
        grid-column: span 8;
    }

    .workspace:first-of-type .module-third {
        grid-column: span 4;
    }
}

@media (hover: none) and (pointer: coarse) {
    .pad, .key, .step, .slot-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .pad {
        min-height: 60px;
    }

    .step {
        min-height: 20px;
    }

    input[type="range"] {
        height: 30px;
        padding: 10px 0;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
}
