/* Shared Page — layout, header, CTA, play button, footer */
/* Card and sheet music styling comes from tunebook.css */

/* Header panel */
.shared-header-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-standard);
    position: relative;
}

.shared-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.shared-header-body {
    text-align: center;
    padding: 0 70px;
}

.shared-header-title {
    font-family: 'Indie Flower', cursive;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-accent);
    margin: 0 0 4px;
}

.shared-header-tagline {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Desktop: play button bottom right */
.shared-header-play {
    position: absolute;
    bottom: 20px;
    right: 24px;
}

/* Mobile: play button centred below title */
@media (max-width: 600px) {
    .shared-header-body {
        padding: 0;
    }
    .shared-header-play {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 12px;
    }
}

.shared-header-play .btn-icon {
    font-size: 1.8rem;
    background: var(--bg-card);
    border: 2px solid var(--text-accent);
    border-radius: 50%;
    cursor: pointer;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: var(--shadow-standard);
    transition: all 0.2s ease;
}

.shared-header-play .btn-icon:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-elevated);
}

.shared-header-play .btn-icon:active {
    transform: scale(0.95);
}

.shared-header-play .btn-icon.playing {
    border-color: #8b4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2), var(--shadow-standard);
}

/* Settings line between header and content */
.shared-settings-line {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 0 16px;
}

.shared-setting-item {
    white-space: nowrap;
}

/* Loading */
.shared-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.shared-error {
    text-align: center;
    padding: 80px 20px;
}

.shared-error h2 {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.shared-error p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Override tunebook's 4-column grid — no drag handle or actions on shared page */
.shared-tune-header {
    display: block !important;
}

.shared-title-subtitle {
    font-weight: normal;
    color: var(--text-secondary);
}

.shared-title-subtitle.shared-title-small {
    font-size: 1.1rem;
}

/* Playback limit banner */
.shared-limit-banner {
    text-align: center;
    padding: 20px;
    margin: 0 0 24px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.shared-limit-banner p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* CTA Section */
.shared-cta {
    padding: 48px 20px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 20px;
}

.shared-cta-content {
    max-width: 500px;
    margin: 0 auto;
}

.shared-cta h2 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.6rem;
    color: var(--text-accent);
    margin-bottom: 8px;
}

.shared-cta p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.shared-cta-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    background: var(--gradient-green);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: var(--btn-3d-shadow-base), var(--btn-3d-inset);
    transition: all 0.2s ease;
}

.shared-cta-btn:hover {
    box-shadow: var(--btn-3d-shadow-hover), var(--btn-3d-inset-hover);
    transform: translateY(-1px);
}

/* Footer */
.shared-footer {
    padding: 24px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 40px;
}

.shared-footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.shared-footer-links {
    margin-top: 8px;
}

.shared-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.shared-footer-links a:hover {
    color: var(--text-accent);
}

.shared-footer-links span {
    margin: 0 6px;
}

/* Open tune page link — top right of card */
.shared-open-link {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--text-accent);
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    z-index: 1;
}

.shared-open-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Cursor highlighting during playback — match main page green style */
#sharedSheetMusic .abcjs-cursor,
#sharedSheetMusic .abcjs-cursor *,
#sharedSheetMusic .abcjs-cursor path,
#sharedSheetMusic .abcjs-cursor ellipse,
#sharedSheetMusic .abcjs-cursor circle,
#sharedSheetMusic .abcjs-cursor text {
    fill: #28a745 !important;
    stroke: #28a745 !important;
}

.dark-theme #sharedSheetMusic .abcjs-cursor,
.dark-theme #sharedSheetMusic .abcjs-cursor *,
.dark-theme #sharedSheetMusic .abcjs-cursor path,
.dark-theme #sharedSheetMusic .abcjs-cursor ellipse,
.dark-theme #sharedSheetMusic .abcjs-cursor circle,
.dark-theme #sharedSheetMusic .abcjs-cursor text {
    fill: #2ecc71 !important;
    stroke: #2ecc71 !important;
}

/* Print: hide non-content elements */
@media print {
    .shared-top-bar,
    .shared-item-actions,
    .shared-header-play,
    .shared-header-top-row,
    .shared-cta,
    .shared-footer,
    .shared-limit-banner,
    .theme-toggle-button {
        display: none !important;
    }
}
