/**
 * John Metcalf Score Manager - Theme Integration Styles
 * 
 * Custom styles to ensure our plugin integrates well with the john2016 theme
 */

/* Enhanced Score titles with Work name */
.single-product .product_title {
    line-height: 1.3;
}

.single-product .product_title .jm-work-separator {
    color: #666;
    font-weight: normal;
}

/* Score/Work meta information */
.jm-meta-scores,
.jm-meta-rental,
.jm-meta-parent,
.jm-meta-pages {
    margin: 0.5em 0;
    font-size: 0.9em;
}

.jm-score-type {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

.jm-meta-rental {
    color: #4CAF50;
}

/* Work CTA Buttons Container */
.jm-work-cta-buttons {
    margin: 1em 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Purchase Scores Call-to-Action Button */
.jm-purchase-scores-cta {
    margin: 1em 0;
}

.jm-scores-cta-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.jm-scores-cta-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004168 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.jm-scores-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.jm-cta-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.jm-cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.jm-cta-text strong {
    font-size: 18px;
    margin-bottom: 2px;
}

.jm-cta-text small {
    font-size: 11px;
    opacity: 0.9;
    font-weight: normal;
}

/* Rental CTA Button - matches Purchase Scores styling */
.jm-rental-cta-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.jm-rental-cta-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004168 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.jm-rental-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

/* Purchase CD Call-to-Action Button */
.jm-purchase-cd-cta {
    margin: 1em 0;
}

.jm-cd-cta-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.jm-cd-cta-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004168 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.jm-cd-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.jm-cd-cta-button .jm-cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.jm-cd-cta-button .jm-cta-text strong {
    font-size: 18px;
    margin-bottom: 2px;
}

.jm-cd-cta-button .jm-cta-text small {
    font-size: 11px;
    opacity: 0.9;
    font-weight: normal;
}

/* Purchase Scores Tab Styling */
.jm-purchase-scores-section {
    margin: 1.5em 0;
}

/* Linear Scores List - Elegant and streamlined */
.jm-scores-list-linear {
    margin: 1.5em 0;
}

.jm-score-linear-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25em 1.5em;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    margin-bottom: 0.75em;
    transition: all 0.2s ease;
    gap: 2em;
}

.jm-score-linear-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,124,186,0.1);
    transform: translateY(-1px);
}

.jm-score-linear-item:last-child {
    margin-bottom: 0;
}

.jm-score-info {
    flex: 1;
    min-width: 0; /* Allows text to truncate properly */
}

.jm-score-info h4 {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.jm-score-info h4 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.jm-score-info h4 a:hover {
    color: #007cba;
}

.jm-score-meta {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}

.jm-score-type,
.jm-score-pages {
    font-size: 0.9em;
    color: #666;
    background: #f8f9fa;
    padding: 0.25em 0.75em;
    border-radius: 12px;
    font-weight: 500;
}

.jm-score-type {
    color: #007cba;
    background: rgba(0,124,186,0.1);
}

.jm-score-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75em;
    flex-shrink: 0;
}

.jm-score-price {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    text-align: right;
}

.jm-score-buttons {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.jm-add-to-cart,
.jm-view-details {
    padding: 0.5em 1em;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.jm-add-to-cart {
    background: #007cba;
    color: white;
    border: 2px solid #007cba;
}

.jm-add-to-cart:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
    text-decoration: none;
}

.jm-view-details {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.jm-view-details:hover {
    background: #f8f9fa;
    border-color: #007cba;
    color: #007cba;
    text-decoration: none;
}

/* Responsive adjustments for linear layout */
@media (max-width: 768px) {
    .jm-score-linear-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1em;
        padding: 1em;
    }
    
    .jm-score-actions {
        align-items: stretch;
    }
    
    .jm-score-buttons {
        justify-content: stretch;
    }
    
    .jm-add-to-cart,
    .jm-view-details {
        flex: 1;
        text-align: center;
    }
    
    .jm-score-price {
        text-align: center;
        font-size: 1.2em;
    }
}

.jm-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5em;
    margin: 1.5em 0;
}

.jm-score-purchase-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5em;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.jm-score-purchase-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.jm-score-purchase-card h4 {
    margin: 0 0 0.5em 0;
    color: #333;
}

.jm-score-purchase-card h4 a {
    text-decoration: none;
    color: inherit;
}

.jm-score-purchase-card h4 a:hover {
    color: #007cba;
}

.jm-score-type strong {
    color: #007cba;
    font-style: normal;
}

.jm-score-details {
    font-size: 0.9em;
    color: #666;
    margin: 0.5em 0;
}

.jm-score-purchase {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

.jm-score-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0.5em 0;
}

.jm-score-purchase .button {
    margin: 0.25em;
    min-width: 120px;
}

.jm-score-purchase .button-secondary {
    background: transparent;
    color: #007cba;
    border: 1px solid #007cba;
}

.jm-score-purchase .button-secondary:hover {
    background: #007cba;
    color: white;
}

.jm-rental-section {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 1.5em;
    margin: 2em 0;
    text-align: center;
}

.jm-rental-section h3 {
    color: #1976d2;
    margin-top: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .jm-scores-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }
    
    .jm-score-purchase-card {
        padding: 1em;
    }
    
    .jm-score-purchase .button {
        display: block;
        margin: 0.5em 0;
        width: 100%;
    }
}

/* Work enhancements styling */
.jm-work-enhancements {
    margin: 1.5em 0;
}

.jm-score-sales-cta {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 8px;
    margin: 1em 0;
    border-left: 4px solid #007cba;
}

.jm-score-sales-cta h4 {
    margin-top: 0;
    color: #333;
    font-size: 1.2em;
}

.jm-related-scores {
    margin: 1em 0;
}

.jm-score-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1em;
    margin: 0.5em 0;
    transition: box-shadow 0.2s ease;
}

.jm-score-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.jm-score-title {
    font-weight: bold;
    margin-bottom: 0.5em;
}

.jm-score-meta {
    font-size: 0.9em;
    color: #666;
    margin: 0.25em 0;
}

.jm-score-actions {
    margin-top: 0.75em;
}

.jm-score-actions .button {
    margin-right: 0.5em;
    font-size: 0.9em;
}

/* Score details styling */
.jm-score-details {
    margin: 1.5em 0;
}

.jm-score-info {
    background: #f8f9fa;
    padding: 1.5em;
    border-radius: 8px;
    margin: 1em 0;
}

/* Preview gallery */
.jm-preview-gallery {
    margin: 1.5em 0;
}

.jm-preview-gallery h4 {
    margin-bottom: 1em;
}

.jm-preview-item {
    display: inline-block;
    margin: 0.5em 0.5em 0.5em 0;
    text-align: center;
}

.jm-preview-item img {
    max-width: 150px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.jm-preview-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.jm-preview-caption {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.5em;
}

.jm-audio-player h4 {
    margin-bottom: 0.75em;
    color: #333;
}

.jm-audio-description {
    margin: 0;
    font-size: 1.5rem;
    font-style: italic;
}

/* CD purchase links */
.jm-cd-purchase-links {
    margin: 1.5em 0;
}

.jm-purchase-platforms {
    margin: 1em 0;
}

.jm-platform-link {
    display: inline-block;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.75em 1em;
    margin: 0.5em 0.5em 0.5em 0;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    font-weight: 500;
}

.jm-platform-link:hover {
    border-color: #007cba;
    color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.jm-platform-link.featured {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.jm-platform-link.featured:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
}

.jm-platform-icon {
    margin-right: 0.5em;
    font-size: 1.2em;
}

.jm-link-type {
    font-size: 0.85em;
    opacity: 0.8;
    margin-left: 0.5em;
}

/* Rental information */
.jm-rental-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
}

.jm-rental-info h4 {
    color: #1976d2;
    margin-top: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .jm-score-item {
        padding: 0.75em;
    }
    
    .jm-platform-link {
        display: block;
        text-align: center;
        margin: 0.5em 0;
    }
    
    .jm-preview-item {
        margin: 0.5em 0.25em;
    }
    
    .jm-preview-item img {
        max-width: 120px;
    }
}

/* Integration with existing theme styles */
.jpm-piece-overview + .jm-work-enhancements,
.jpm-piece-overview + .jm-score-details {
    margin-top: 1em;
}

/* ===================================================
   CD PURCHASE LINKS - LIGHT THEME OVERRIDE
   =================================================== */

/* Light container styling */
.jm-cd-purchase-section {
    background: #fafbfc;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 2em;
    margin: 1.5em 0;
}

.jm-cd-purchase-section h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 1.5em;
    font-weight: 600;
}

/* Light theme for purchase links */
.jm-purchase-link {
    background: white !important;
    border: 1px solid #e1e5e9 !important;
    color: #555 !important;
    padding: 1.25em 1.5em !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease !important;
    font-size: 1.1em !important;
    line-height: 1.4 !important;
}

.jm-purchase-link:hover {
    border-color: #007cba !important;
    color: #007cba !important;
    box-shadow: 0 2px 8px rgba(0,124,186,0.1) !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

/* Featured link - much lighter styling */
.jm-purchase-link.jm-featured {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%) !important;
    border: 2px solid #007cba !important;
    color: #005a87 !important;
    font-weight: 600 !important;
    font-size: 1.2em !important;
    padding: 1.5em 1.75em !important;
    position: relative;
}

.jm-purchase-link.jm-featured:hover {
    background: linear-gradient(135deg, #e8f2ff 0%, #d4edff 100%) !important;
    color: #004168 !important;
    border-color: #005a87 !important;
}

.jm-purchase-link.jm-featured::before {
    content: "⭐";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Platform icons - lighter styling */
.jm-platform-icon {
    font-size: 1.5em !important;
    opacity: 0.8;
    filter: grayscale(0.2);
}

.jm-purchase-link:hover .jm-platform-icon {
    opacity: 1;
    filter: grayscale(0);
}

/* Platform text styling */
.jm-platform-text strong {
    color: inherit;
    font-weight: 600;
    font-size: 1.05em;
}

.jm-platform-text small {
    color: #777;
    font-size: 0.9em;
}

.jm-purchase-link:hover .jm-platform-text small {
    color: #007cba;
}

/* Link types - subtle badges */
.jm-link-type {
    background: #f1f3f4 !important;
    color: #5f6368 !important;
    padding: 0.4em 0.9em !important;
    border-radius: 12px !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
}

.jm-purchase-link:hover .jm-link-type {
    background: rgba(0,124,186,0.1) !important;
    color: #007cba !important;
}

/* Link arrows */
.jm-link-arrow {
    color: #bbb !important;
    transition: all 0.2s ease;
}

.jm-purchase-link:hover .jm-link-arrow {
    color: #007cba !important;
    transform: translateX(3px);
}