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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.master-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.playlist-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.playlist-manager {
    margin-bottom: 15px;
}

.playlist-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#playlistSelect {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

#createPlaylistBtn, #deletePlaylistBtn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

#createPlaylistBtn {
    background: #667eea;
    color: white;
}

#deletePlaylistBtn {
    background: #dc3545;
    color: white;
}

#createPlaylistBtn:hover, #deletePlaylistBtn:hover {
    opacity: 0.8;
}

.create-playlist-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 2px solid #667eea;
}

#playlistNameInput {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#savePlaylistBtn, #cancelPlaylistBtn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#savePlaylistBtn {
    background: #28a745;
    color: white;
}

#cancelPlaylistBtn {
    background: #6c757d;
    color: white;
}

#fileInput, #effectsInput {
    margin-bottom: 15px;
    padding: 10px;
    width: 100%;
}

.playlist {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.playlist-item {
    padding: 8px;
    margin: 5px 0;
    background: #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.playlist-item:hover {
    background: #dee2e6;
    transform: translateX(5px);
}

.playlist-item.playing {
    background: #667eea;
    color: white;
}



.playlist-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.playlist-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

#playBtn {
    background: #28a745;
    color: white;
}

#pauseBtn {
    background: #ffc107;
    color: #333;
}

#stopBtn {
    background: #dc3545;
    color: white;
}

#crossfadeBtn {
    background: #17a2b8;
    color: white;
}

#shuffleBtn {
    background: #6f42c1;
    color: white;
}

#shuffleBtn.active {
    background: #5a32a3;
    box-shadow: 0 0 10px rgba(111, 66, 193, 0.5);
}

.btn-manage {
    background: #fd7e14;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
    display: inline-block;
}

.btn-manage:hover {
    background: #e8590c;
    transform: scale(1.05);
}

.playlist-controls button:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.decks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.deck {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.deck-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.track-name {
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    margin: 10px 0;
    cursor: pointer;
}

.deck-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.deck-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    flex: 1;
}

.deck-play-btn {
    background: #28a745;
    color: white;
}

.deck-pause-btn {
    background: #ffc107;
    color: #333;
}

.deck-stop-btn {
    background: #dc3545;
    color: white;
}

.deck-buttons button:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.deck-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-volume {
    width: 200px;
}

input[type="range"] {
    cursor: pointer;
}

.effects-deck {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.effects-deck h2 {
    color: white;
}

.effects-matrix-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    margin-bottom: 10px;
}

#matrixNameInput {
    padding: 10px;
    border: 2px solid white;
    border-radius: 5px;
    font-size: 14px;
}

#saveMatrixBtn, #loadMatrixBtn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

#saveMatrixBtn {
    background: #667eea;
    color: white;
}

#loadMatrixBtn {
    background: #ffc107;
    color: #333;
}

#saveMatrixBtn:hover, #loadMatrixBtn:hover {
    opacity: 0.8;
}

.effects-matrix {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.effect-cell {
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-align: center;
    padding: 4px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.2;
}

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

.effect-cell.loaded {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
}

.effect-cell.effect-active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    border-color: #ff6b6b;
    animation: glow 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}

.effect-cell.playing {
    animation: pulse 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 107, 107, 0.9);
    }
}

.effect-cell .remove-effect {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.effect-cell.loaded:hover .remove-effect {
    display: flex;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    min-width: 400px;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

#matrixSelect {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

#matrixSelect option {
    padding: 10px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#confirmLoadMatrixBtn {
    background: #28a745;
    color: white;
}

#cancelLoadMatrixBtn {
    background: #6c757d;
    color: white;
}

.effects-controls {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
}

.effects-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.effect-control-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

#pauseEffectsBtn {
    background: #ffc107;
    color: #333;
}

#stopEffectsBtn {
    background: #dc3545;
    color: white;
}

.effect-control-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.effects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.effect-button {
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
}

.effect-button:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.effect-button:active {
    transform: translateY(0);
}

.effect-button .remove-effect {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

label {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="number"] {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 60px;
}
