/* Music Box - Main Plugin Styles */

.chords-container {
    color: #333;
    overflow: visible;
    position: relative;
}
.chords-container > :first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


.chords-container > p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Button Base Styles */
.advanced-buttons {
    display: flex;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 20px;
    overflow: visible;
    white-space: nowrap;
}

.key-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 20px;
    overflow: visible;
}

.advanced-button,
.key-button {
    padding: 8px 16px;
    border: 2px solid #39CCA8;
    background: #fff;
    color: #39CCA8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.key-button {
    min-width: 50px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advanced-button:hover,
.key-button:hover {
    background: #39CCA8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.3);
}

.key-button.active {
    background: #39CCA8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.4);
    transform: scale(1.05);
}

/* Advanced Button Highlighting */
.advanced-button.highlighted {
    background: #39CCA8 !important;
    color: #fff;
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.4);
}

.advanced-button.highlighted:hover {
    background: #39CCA8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.4);
}

.advanced-button.highlighted:focus {
    background: #39CCA8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.4);
}

/* Delete mode - higher specificity to override highlighting */
.advanced-button.delete-mode {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
    animation: pulse-red 1s infinite;
}

/* Delete mode with highlighting - highest specificity */
.advanced-button.highlighted.delete-mode,
.advanced-button.delete-mode.highlighted {
    background: #ff6b6b !important;
    border-color: #ff6b6b;
    color: #fff;
    box-shadow: none;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* Modal Styles */
.chord-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.chord-modal {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    border: 2px solid #39CCA8;
}

.chord-modal h3 {
    color: #333;
    margin: 0 0 20px 0;
}

.chord-modal p {
    color: #666;
    margin: 0 0 25px 0;
}

.chord-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.chord-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.chord-modal-btn.cancel {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

.chord-modal-btn.cancel:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.chord-modal-btn.delete {
    background: #ff6b6b;
    color: #fff;
    border: 2px solid #ff6b6b;
}

.chord-modal-btn.delete:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Chord Content Styling */
.chord-content {
    white-space: pre;
    overflow-x: auto !important;
    overflow-y: visible !important;
    word-wrap: normal;
    word-break: keep-all;
    line-height: 1.6;
    margin-top: 0;
}

.mb-chords-preserve {
    white-space: pre-wrap;
}

.chord-content.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    overflow: visible;
}

.chord-content.split-layout .split-column {
    white-space: pre;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    word-wrap: normal;
    word-break: keep-all;
    line-height: 1.6;
}

.chord-content p {
    margin-top: 0;
    margin-bottom: 0; /* Match the spacing of non-shortcode content */
    line-height: 1.6;
}
.chord-content p:empty {
    display: none;
}
.chord-content p br:only-child {
    display: none;
}
/* Remove extra spacing from <br> tags */
.chord-content p br {
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Chord Highlighting */
.chord {
    display: inline-block;
    color: #FF0000;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.chord::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.chord:hover::before {
    left: 100%;
}

.chord:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .advanced-buttons {
        gap: 6px;
        padding: 3px 0 4px 0;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .advanced-button {
        padding: 6px 12px;
    }
    
    .advanced-button.split-content {
        display: none !important;
    }
    
    .advanced-button.share-content {
        display: none !important;
    }
    
    .key-buttons {
        gap: 6px;
    }
    
    .key-button {
        padding: 6px 10px;
        min-width: 45px;
        min-height: 35px;
    }
    
    .chord-content.split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .chord {
        position: relative;
        z-index: 1;
        /* Increase touch area without changing visual size */
        padding: 14px 14px;
        margin: -14px -14px;
        background-clip: content-box;
    }
}

@media (max-width: 480px) {
    .key-buttons {
        justify-content: center;
    }
    
    .key-button {
        padding: 5px 8px;
        min-width: 40px;
        min-height: 30px;
    }
}

/* Print styles */
@media print {
    .chords-container {
        color: #000;
    }
    
    .key-buttons {
        display: none;
    }
    
    .chord {
        color: #FF0000;
        text-shadow: none;
    }
}

/* Notification System */
.chord-notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    overflow: visible;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .chord-notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chord-notifications-container .chord-message {
        max-width: none;
        margin-bottom: 8px;
    }
}

.chord-notifications-container .chord-message {
    pointer-events: auto;
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Message System */
.chord-message {
    position: relative;
    padding: 15px 20px;
    padding-right: 40px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 1;
}

.chord-message.success {
    background: #4caf50;
    border-left: 4px solid #2e7d32;
}

.chord-message.error {
    background: #f44336;
    border-left: 4px solid #c62828;
}

.chord-message.info {
    background: #2196f3;
    border-left: 4px solid #1565c0;
}

.chord-message-text {
    flex: 1;
    margin-right: 10px;
}

.chord-message-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.chord-message-close:hover {
    color: #fff;
} 