/* Browse Page Styles - Celtic Theme */

/* Header */
.browse-header {
    background: var(--bg-card);
    padding: 20px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-subtle);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Auth section absolutely positioned - matching homepage */
.auth-section-top {
    position: absolute;
    left: 40px;
    right: 40px;
    top: 25px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo button styling - matching dashboard */
.logo-button-container {
    display: flex;
    align-items: center;
}

.logo-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    border: 2px solid #d4af37;
    overflow: hidden;
    position: relative;
}

.logo-home-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    object-fit: cover;
}

.logo-home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
    border-color: #f1c40f;
}

.logo-home-button:hover .logo-home-img {
    transform: scale(1.05);
}

/* Dark theme logo button */
.dark-theme .logo-home-button {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .logo-home-button:hover {
    border-color: #f1c40f;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

/* Browse title section */
.browse-title-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}

/* Theme toggle positioning */
.theme-toggle {
    position: absolute;
    top: 91px;
    right: 60px;
    background: var(--bg-button-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-standard);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.back-link {
    color: var(--text-accent);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.back-link:hover {
    transform: translateX(-4px);
}

.browse-header h1 {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--text-accent);
    font-size: 2rem;
    font-weight: 400;
    margin: 0;
}

/* Loading state */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Stats section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--text-accent);
    margin: 0 0 8px 0;
    font-weight: 600;
}

.stat-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Filter section */
.filter-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-light);
}

.filter-section h2 {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--text-accent);
    font-size: 1.3rem;
    margin: 0 0 16px 0;
    font-weight: 400;
}

.search-filter {
    margin-bottom: 24px;
}

.search-filter input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    margin-top: 8px;
}

.search-filter input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(42, 84, 52, 0.1);
}

.dark-theme .search-filter input {
    color: #f4e4bc !important;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    font-size: 1rem;
    color: var(--text-accent);
    margin: 0 0 8px 0;
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background: #faf7f0;
    color: var(--text-accent);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dark-theme .filter-btn {
    background: var(--gradient-brown);
    color: #f4e4bc;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.filter-btn:hover {
    background: var(--bg-accent);
    border-color: var(--text-accent);
}

.dark-theme .filter-btn:hover:not(.active) {
    background: linear-gradient(135deg, #a0522d, #8b4513);
    border-color: var(--text-accent);
}

.filter-btn.active {
    background: var(--bg-button-primary);
    color: white;
    border-color: transparent;
}

.dark-theme .filter-btn.active {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    color: white !important;
    border-color: transparent !important;
}

/* Desktop: Force line break before Polkas in type filters */
@media (min-width: 768px) {
    #typeFilters .filter-btn:nth-child(n+6) {
        order: 2;
    }

    #typeFilters::after {
        content: '';
        flex-basis: 100%;
        order: 1;
    }
}

/* Arrangements section */
.arrangements-section {
    margin-bottom: 60px;
}

.arrangements-section h2 {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--text-accent);
    font-size: 1.5rem;
    margin: 0 0 24px 0;
    font-weight: 400;
    text-align: center;
}

.arrangements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.arrangement-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.arrangement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--text-accent), var(--text-green));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.arrangement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.arrangement-card:hover::before {
    opacity: 1;
}

.tune-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.tune-title {
    font-size: 1.1rem;
    color: var(--text-accent);
    margin: 0;
    font-weight: 600;
    flex: 1;
}

.dark-theme .tune-title {
    color: var(--text-muted);
}

.tune-type-badge {
    background: var(--bg-accent);
    color: var(--text-accent);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.arrangement-details {
    margin-bottom: 16px;
}

.arrangement-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 4px 0;
}

.best-arrangement {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    font-style: italic;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
}

.view-btn {
    background: var(--bg-button-primary);
    color: white;
    border: 2px solid var(--btn-green-border);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--btn-3d-shadow-base);
}

.view-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--btn-3d-shadow-hover);
    border-color: var(--btn-green-border-hover);
}

/* Dark theme: Use EXACT same 3D style as main page btn-primary with swapped colors */
.dark-theme .view-btn {
    background: linear-gradient(135deg, #a0522d, #8b4513);
    color: #f4e4bc;
    border: 2px solid rgba(160, 82, 45, 0.3);
    box-shadow: 0 3px 8px rgba(160, 82, 45, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.dark-theme .view-btn:hover {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
    border-color: rgba(212, 175, 55, 0.5);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Footer */
.browse-footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.browse-footer a {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 500;
}

.browse-footer a:hover {
    text-decoration: underline;
}

.dark-theme .browse-footer {
    color: var(--text-muted) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .auth-section-top {
        left: 20px;
        right: 20px;
        top: 15px;
    }
    
    .header-content {
        padding: 85px 20px 20px 20px;
    }
    
    .theme-toggle {
        top: 135px;
        left: 290px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .arrangements-grid {
        grid-template-columns: 1fr;
    }
    
    .tune-header {
        flex-direction: column;
        gap: 8px;
    }
}