/**
 * Free Downloads Public Styles
 * Minimal, customizable styles matching joolsscott.co.uk aesthetic
 */

/* ==========================================================================
   Modal Overlay
   ========================================================================== */

.js-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.js-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Modal Content
   ========================================================================== */

.js-modal-content {
    position: relative;
    background: #ffffff;
    max-width: 450px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: jsModalFadeIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes jsModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.js-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.js-modal-close:hover {
    color: #ffffff;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.js-modal-header {
    background: #1a1a1a;
    padding: 35px 30px;
    text-align: center;
}

.js-modal-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #ffffff;
    font-size: 26px;
    font-weight: 400;
    margin: 0 0 8px;
    line-height: 1.3;
}

.js-modal-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   Modal Form
   ========================================================================== */

.js-modal-form {
    padding: 30px;
}

.js-piece-info {
    background: #f8f8f8;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.js-piece-info .dashicons {
    color: #ff0000;
}

.js-form-group {
    margin-bottom: 18px;
}

.js-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.js-form-group .required {
    color: #c00;
}

.js-form-group input[type="text"],
.js-form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.js-form-group input:focus {
    outline: none;
    border-color: #ff0000;
}

/* Consent Checkbox */
.js-consent-group {
    margin-bottom: 24px;
}

.js-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    font-weight: normal !important;
}

.js-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Submit Button */
.js-submit-btn {
    width: 100%;
    background: #ff0000;
    color: #ffffff;
    padding: 15px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.js-submit-btn:hover {
    background: #cc0000;
}

.js-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.js-privacy-note {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 18px 0 0;
}

/* ==========================================================================
   Success Message
   ========================================================================== */

.js-success-message {
    padding: 50px 30px;
    text-align: center;
}

.js-success-icon {
    width: 60px;
    height: 60px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.js-success-message h3 {
    font-size: 24px;
    color: #1a1a1a;
    margin: 0 0 12px;
}

.js-success-message p {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   Sheet Music Grid
   ========================================================================== */

.js-sheet-music-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

/* Force single column on all devices */
.js-columns-1,
.js-columns-2,
.js-columns-3,
.js-columns-4 {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Sheet Music Card - Horizontal Layout
   ========================================================================== */

.js-sheet-music-card {
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
    border: 1px solid #eee;
}

.js-sheet-music-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Card body - horizontal layout on desktop */
.js-card-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
}

/* Thumbnail - 250px on desktop, full width on mobile */
.js-card-thumbnail {
    width: 250px;
    flex-shrink: 0;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Main content area - beside thumbnail on desktop */
.js-card-main {
    flex: 1;
    min-width: 0;
}

/* Title - Sitewide H3 styling */
.js-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
    margin: 0 0 12px;
}

/* Description - Sitewide body styling */
.js-card-description {
    font-family: 'IM Fell DW Pica', Georgia, serif;
    font-size: 18px;
    line-height: 1.8;
    color: #333333;
    margin: 0 0 12px;
}

/* Audio Preview - Native HTML5 player */
.js-audio-preview {
    width: 100%;
    max-width: 100%;
    height: 40px;
    margin: 0;
}

/* Genre tags container */
.js-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Genre tag - matches button styling */
.js-card-genre {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

/* Meta row - contains meta items AND button inline */
.js-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 15px;
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: #666;
}

.js-meta-item strong {
    color: #444;
    font-weight: 500;
}

/* Button inside meta row - push to right */
.js-card-meta .js-download-btn,
.js-card-meta .js-coming-soon {
    margin-left: auto;
}

/* Mobile: Stack vertically, full-width image */
@media (max-width: 768px) {
    .js-card-body {
        flex-direction: column;
        gap: 15px;
    }

    .js-card-thumbnail {
        width: 100%;
        max-width: 100%;
    }

    .js-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .js-card-meta .js-download-btn,
    .js-card-meta .js-coming-soon {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* ==========================================================================
   Download Button
   ========================================================================== */

button.js-download-btn,
.js-card-meta button.js-download-btn,
.js-sheet-music-card button.js-download-btn,
.js-sheet-music-grid button.js-download-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #ff0000 !important;
    background-color: #ff0000 !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    flex-shrink: 0;
    white-space: nowrap;
}

button.js-download-btn:hover,
.js-card-meta button.js-download-btn:hover,
.js-sheet-music-card button.js-download-btn:hover {
    background: #cc0000 !important;
    background-color: #cc0000 !important;
}

/* Choir tracks download - matches PDF button style but grey */
.js-download-choir-tracks {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #666666 !important;
    background-color: #666666 !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.js-download-choir-tracks:hover {
    background: #444444 !important;
    background-color: #444444 !important;
    color: #ffffff !important;
}

.js-download-btn .dashicons {
    display: none;
}

/* Wrapper for multiple download buttons */
.js-download-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Desktop: buttons wrapper to the right */
@media (min-width: 769px) {
    .js-download-buttons-wrapper {
        margin-left: auto;
    }
}

.js-coming-soon {
    display: inline-block;
    background: #f5f5f5;
    color: #888;
    padding: 8px 16px;
    border-radius: 3px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 400;
    flex-shrink: 0;
}

/* ==========================================================================
   Notification Toast
   ========================================================================== */

.js-notification-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 100000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: jsToastSlideUp 0.3s ease;
}

@keyframes jsToastSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ==========================================================================
   No Pieces Message
   ========================================================================== */

.js-no-pieces {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}
