/* ==========================================================================
   Niffty DJ - Authentic Serato DJ Pro Performance Pads Matrix
   (Hot Cue, Auto Loop, AI Stems, Beat Roll, Sampler)
   ========================================================================== */

.performance-pads-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.pad-section-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: space-between;
}

/* ==========================================================================
   Serato Mode Selector Toolbar Header (8 Pro Mode Buttons)
   ========================================================================== */
.pad-toolbar-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 2px !important;
    background: var(--bg-deep-void);
    padding: 2px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    width: 100% !important;
    box-sizing: border-box;
    flex-shrink: 0;
}

.pad-mode-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 2px 1px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    transition: all 0.15s ease;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.pad-mode-btn:hover {
    color: #fff;
    background: var(--bg-surface);
    border-color: rgba(255, 255, 255, 0.25);
}

.pad-mode-btn .mode-number {
    font-size: 6.5px;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 1px 2px;
    border-radius: 2px;
    font-family: var(--font-mono);
    flex-shrink: 0;
    color: var(--text-secondary);
}

.pad-mode-btn .mode-name {
    font-size: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pad-mode-btn.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--mode-color);
    border-color: var(--mode-color);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.pad-mode-btn.active .mode-number {
    background-color: var(--mode-color);
    color: #000;
    font-weight: 900;
}

/* ==========================================================================
   Active Mode Content & Dedicated Views
   ========================================================================== */
.pad-content-zone {
    flex: 1;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.pad-mode-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    flex: 1;
    min-height: 0;
    gap: 2px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Mode Header Info Strip */
.pad-mode-header-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 3px;
    background: var(--bg-deep-void);
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    height: 15px;
    box-sizing: border-box;
}

.pad-mode-status-badge {
    font-size: 7px;
    font-weight: 900;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    color: var(--neon-cyan);
}

.pad-mode-hint {
    font-size: 6.5px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Serato Auto Loop Toolbar
   ========================================================================== */
.serato-loop-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1.6fr;
    gap: 2px;
    flex-shrink: 0;
    height: 18px;
    width: 100%;
    box-sizing: border-box;
}

.serato-loop-tool-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 7.5px;
    font-weight: 900;
    font-family: var(--font-mono);
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    padding: 0 1px;
}

.serato-loop-tool-btn:hover {
    background: var(--bg-surface);
    border-color: var(--neon-emerald);
    color: #fff;
}

.serato-loop-tool-btn.reloop-btn {
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--neon-emerald);
}

.serato-loop-tool-btn.reloop-btn.active {
    background: var(--neon-emerald);
    color: #000;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* ==========================================================================
   Serato Beat Roll Speed & Division Toolbar (Fits 100% into Canvas)
   ========================================================================== */
.serato-roll-toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1.5fr 0.8fr 1fr !important;
    align-items: center !important;
    gap: 2px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    background: var(--bg-deep-void) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 3px !important;
    padding: 1px 2px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
}

.roll-tool-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #f59e0b;
    font-size: 7px;
    font-weight: 900;
    font-family: var(--font-mono);
    border-radius: 2px;
    padding: 1px 2px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

.roll-tool-btn:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.roll-tool-btn.active {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.roll-bank-badge {
    font-size: 6.8px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #ffffff;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

/* ==========================================================================
   16-Pad Performance Matrix (Fits 100% to Canvas without scrolling)
   ========================================================================== */
.pads-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
    gap: 2px !important;
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Tactile Silicone Performance Pad */
.dj-pad {
    background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.08s cubic-bezier(0.2, 0.8, 0.2, 1);
    height: 100%;
    min-height: 0 !important;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    user-select: none;
}

.dj-pad:hover {
    border-color: var(--pad-color);
    background: linear-gradient(180deg, #222d42 0%, #111726 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), 0 0 8px rgba(var(--pad-color), 0.35);
}

.dj-pad:active, .dj-pad.playing {
    background: var(--pad-color) !important;
    color: #000 !important;
    box-shadow: 0 0 16px var(--pad-color), inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: scale(0.97);
    border-color: #ffffff !important;
}

.dj-pad:active .pad-num-badge,
.dj-pad:active .pad-main-title,
.dj-pad:active .pad-sub-label,
.dj-pad.playing .pad-num-badge,
.dj-pad.playing .pad-main-title,
.dj-pad.playing .pad-sub-label {
    color: #000 !important;
}

/* Active Hot Cue / Auto Loop State */
.dj-pad.active {
    border-color: var(--pad-color) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.5) 100%), #121a28;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35), inset 0 0 8px rgba(0, 240, 255, 0.2);
}

.dj-pad.empty {
    opacity: 0.55;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
}

.dj-pad.empty:hover {
    opacity: 1;
    border-style: solid;
    border-color: var(--pad-color);
}

/* Pad Typography & Badges */
.pad-num-badge {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 6px;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.45);
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.dj-pad.active .pad-num-badge {
    color: var(--pad-color);
    font-weight: 900;
}

.pad-main-title {
    font-size: 7.5px;
    font-weight: 900;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    max-width: 95%;
    margin-top: 1px;
    letter-spacing: 0.2px;
}

.pad-sub-label {
    font-size: 5.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    line-height: 1;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.dj-pad.active .pad-sub-label {
    color: var(--pad-color);
    font-weight: 900;
}

/* ==========================================================================
   Auto-Loop Specific Glow
   ========================================================================= */
.loop-pad.active {
    border-color: #10b981 !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.7), inset 0 0 10px rgba(16, 185, 129, 0.3) !important;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.25) 0%, var(--bg-surface) 100%) !important;
}

.loop-pad.active .pad-main-title {
    color: #10b981 !important;
}

/* ==========================================================================
   AI Stems Specific Pad Matrix
   ========================================================================== */
.stem-icon-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: block;
    margin: 1px auto;
}

.stem-pad.stem-mute-pad.active {
    border-color: var(--pad-color);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15), inset 0 0 6px rgba(255, 255, 255, 0.1);
}

.stem-pad.stem-mute-pad.active .pad-main-title {
    color: #ffffff;
}

.stem-pad.stem-mute-pad.active .pad-sub-label {
    color: var(--pad-color);
    font-weight: 900;
}

.stem-pad.stem-mute-pad.muted {
    opacity: 0.35;
    background: var(--bg-deep-void) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: none !important;
}

.stem-pad.stem-mute-pad.muted .pad-main-title {
    text-decoration: line-through;
    color: var(--text-muted) !important;
}

.stem-pad.stem-mute-pad.muted .pad-sub-label {
    color: #ff3366 !important;
}

.stem-pad.stem-action-pad.active-solo {
    background: var(--pad-color) !important;
    color: #000 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 12px var(--pad-color);
}

.stem-pad.stem-action-pad.active-solo .pad-main-title,
.stem-pad.stem-action-pad.active-solo .pad-sub-label {
    color: #000 !important;
}
