/**
 * RingChime Additional Styles
 * Complements main site styles
 */

/* Theme Variables - Dark Theme (Default) */
:root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-muted: #b0b0b0;
    --card-bg: #2a2a2a;
    --border-color: #3a3a3a;
    --hover-bg: #3a3a3a;
    --primary-color: #5caaff;
    /* Lightened from #4a9eff for better contrast on dark bg */
    --primary-hover: #7cc0ff;
    --btn-primary-bg: #0069d9;
    --btn-primary-hover: #0056b3;
    --preview-bg: #1f1f2e;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

/* Light Theme */
[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --btn-primary-bg: #007bff;
    --btn-primary-hover: #0056b3;
    --preview-bg: #f8f9ff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* Play button visibility in light theme */
[data-theme="light"] .track-actions .preview-player::-webkit-media-controls-play-button {
    background-color: var(--primary-color, #007bff) !important;
    color: white !important;
}

/* Apply theme to body and main content */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-content {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* RTL (Right-to-Left) Support for Hebrew and Arabic */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body,
html[dir="rtl"] .main-content {
    direction: rtl;
    text-align: right;
}

/* RTL: Reverse flex direction for navigation */
html[dir="rtl"] .nav-container,
html[dir="rtl"] .nav-controls,
html[dir="rtl"] .nav-controls-main-group {
    flex-direction: row-reverse;
}

/* RTL: Reverse breadcrumbs separator */
html[dir="rtl"] .breadcrumbs .separator {
    transform: scaleX(-1);
}

/* RTL: Adjust text alignment */
html[dir="rtl"] .track-info h3,
html[dir="rtl"] .track-title,
html[dir="rtl"] .brand-description,
html[dir="rtl"] .language-name {
    text-align: right;
}

/* RTL: Reverse language menu grid */
html[dir="rtl"] .language-grid {
    direction: rtl;
}

/* RTL: Adjust language item alignment */
html[dir="rtl"] .language-item {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .language-flag {
    margin-right: 0;
    margin-left: 0.75rem;
}

/* RTL: Adjust search form */
html[dir="rtl"] .global-search-form {
    flex-direction: row-reverse;
}

html[dir="rtl"] .global-search-button {
    left: auto;
    right: 0.75rem;
}

/* RTL: Adjust pagination */
html[dir="rtl"] .pagination-list {
    flex-direction: row-reverse;
}

/* RTL: Adjust track actions */
html[dir="rtl"] .track-actions {
    flex-direction: row-reverse;
}

/* RTL: Adjust brand description accordion */
html[dir="rtl"] .brand-description-header {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .brand-description-toggle {
    flex-direction: row-reverse;
}

/* RTL: Adjust language menu header */
html[dir="rtl"] .language-menu-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .language-menu-close {
    order: -1;
}

/* Brand Grid - Modern Redesign */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.brand-card {
    background: var(--card-bg, #2a2a2a);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: 1px solid var(--border-color, #3a3a3a);
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
    position: relative;
    overflow: hidden;
}

.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #4a9eff), var(--primary-hover, #6bb0ff));
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover, rgba(0, 0, 0, 0.4));
    border-color: var(--primary-color, #4a9eff);
}

.brand-card:hover::before {
    transform: scaleX(1);
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-card:hover .brand-logo img {
    transform: scale(1.05);
}

.brand-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-card:hover .brand-logo-fallback {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.brand-letter {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1;
    letter-spacing: -0.02em;
}

.brand-card h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-color, #212529);
    transition: color 0.2s;
}

.brand-card:hover h2 {
    color: var(--primary-color, #4a9eff);
}

.brand-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.brand-logo-large {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    margin: 0 auto;
}

.track-count {
    color: var(--text-muted, #a0a0a0);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 12px;
    display: inline-block;
    transition: all 0.2s;
}

.brand-card:hover .track-count {
    background: rgba(74, 158, 255, 0.25);
    color: var(--primary-color, #4a9eff);
}

/* Popular Tracks Section */
.popular-tracks-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color, #3a3a3a);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    color: var(--text-color, #e0e0e0);
    text-align: center;
}

.track-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted, #a0a0a0);
}

.downloads-count,
.rating-display-small {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.downloads-count i,
.rating-display-small i {
    font-size: 0.875rem;
}

.downloads-count i {
    color: var(--primary-color, #4a9eff);
}

.rating-display-small i {
    color: #ffc107;
}

.no-tracks {
    text-align: center;
    color: var(--text-muted, #a0a0a0);
    padding: 2rem;
    font-size: 1.1rem;
}

/* Content Pages (Privacy, Terms, etc.) */
.content-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.content-page h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    color: var(--text-color, #e0e0e0);
}

.content-text {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color, #3a3a3a);
    line-height: 1.8;
    color: var(--text-color, #e0e0e0);
}

.content-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--text-color, #e0e0e0);
}

.content-text h2:first-of-type {
    margin-top: 0;
}

.content-text p {
    margin: 1rem 0;
    font-size: 1rem;
}

.content-text em {
    color: var(--text-muted, #a0a0a0);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .content-page {
        padding: 1rem 0;
    }

    .content-page h1 {
        font-size: 2rem;
    }

    .content-text {
        padding: 1.5rem;
    }

    .content-text h2 {
        font-size: 1.25rem;
    }
}

/* TOP50 Ringchime Styles */
.brand-card-top50 {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    border: 2px solid var(--primary-color, #4a9eff);
}

.brand-card-top50:hover {
    border-color: var(--primary-hover, #6bb0ff);
    box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
}

.brand-logo-top50 .brand-logo-fallback {
    background: linear-gradient(135deg, var(--btn-primary-bg, #007bff) 0%, var(--btn-primary-hover, #0056b3) 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.top50-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--card-bg, #2a2a2a);
    border-radius: 16px;
    border: 1px solid var(--border-color, #3a3a3a);
}

.top50-logo {
    flex-shrink: 0;
}

.top50-logo-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--btn-primary-bg, #007bff) 0%, var(--btn-primary-hover, #0056b3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
}

.top50-logo-badge.small {
    width: 60px;
    height: 60px;
}

.top50-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.top50-logo-badge.small .top50-number {
    font-size: 1.5rem;
}

.top50-intro {
    flex: 1;
}

.top50-intro h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color, #e0e0e0);
}

.top50-subtitle {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-muted, #a0a0a0);
}

/* TOP50 Sort Selector */
.top50-sort-selector {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg, #2a2a2a);
    border-radius: 16px;
    border: 1px solid var(--border-color, #3a3a3a);
}

.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--hover-bg, #3a3a3a);
    color: var(--text-color, #e0e0e0);
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid var(--border-color, #3a3a3a);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sort-button i {
    font-size: 1rem;
    opacity: 0.8;
}

.sort-button:hover {
    background: var(--hover-bg, #3a3a3a);
    border-color: var(--primary-color, #4a9eff);
    color: var(--text-color, #e0e0e0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.sort-button:hover i {
    opacity: 1;
}

.sort-button.active {
    background: linear-gradient(135deg, var(--btn-primary-bg, #007bff) 0%, var(--btn-primary-hover, #0056b3) 100%);
    color: white;
    border-color: var(--btn-primary-bg, #007bff);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
}

.sort-button.active i {
    opacity: 1;
}

.sort-button.active:hover {
    background: linear-gradient(135deg, var(--btn-primary-hover, #0056b3) 0%, var(--btn-primary-bg, #007bff) 100%);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
    transform: translateY(-2px);
}

.top50-tracks-section {
    margin-top: 2rem;
}

.top50-track-card {
    position: relative;
    overflow: visible;
}

.top50-position {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.position-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--card-bg, #2a2a2a) 0%, var(--hover-bg, #3a3a3a) 100%);
    border: 2px solid var(--primary-color, #4a9eff);
    color: var(--primary-color, #4a9eff);
    font-weight: 700;
    font-size: 1.35rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.top50-track-card:hover .position-number {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

/* Top 3 positions - special styling */
.top50-track-card:nth-child(1) .position-number {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: #FFD700;
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5);
    font-size: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
}

.top50-track-card:nth-child(2) .position-number {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    border-color: #C0C0C0;
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.5);
    font-size: 1.45rem;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
}

.top50-track-card:nth-child(3) .position-number {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    border-color: #CD7F32;
    color: white;
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.5);
    font-size: 1.4rem;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
}

.top50-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
    background: var(--card-bg, #2a2a2a);
    padding: 0.5rem;
}

/* RTL Support for TOP50 */
html[dir="rtl"] .top50-header {
    flex-direction: row-reverse;
}


html[dir="rtl"] .sort-buttons {
    flex-direction: row-reverse;
}

/* RTL support for inline position number is handled by track-meta */

/* Device Grid */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.device-card {
    background: var(--card-bg, #2a2a2a);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #3a3a3a);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover, rgba(0, 0, 0, 0.3));
    border-color: var(--primary-color, #4a9eff);
}

.device-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.device-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.devices-section {
    margin-top: 3rem;
}

.devices-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.tracks-preview-section {
    margin-top: 3rem;
}

.tracks-preview-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.view-button {
    padding: 0.625rem 1rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.view-button:hover {
    background: var(--btn-primary-hover, #0056b3);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

/* Tracks Grid */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: stretch;
}

.track-card {
    background: var(--card-bg, #2a2a2a);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    min-height: 200px;
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border-color, #3a3a3a);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.track-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover, rgba(0, 0, 0, 0.3));
    border-color: var(--primary-color, #4a9eff);
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Ensure track-info in TOP50 cards has proper spacing and doesn't overlap with position */
.top50-track-card .track-info {
    padding-left: 0;
    margin-left: 0;
    margin-top: 0;
    padding-top: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    align-items: flex-start;
}

.top50-track-card .track-info h3 {
    margin-top: 0;
    padding-top: 0;
}

.track-info h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color, #e0e0e0);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
    max-height: 2.8em;
}

.track-info h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.track-info h3 a:hover {
    color: var(--primary-color, #4a9eff);
}

.track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted, #a0a0a0);
    margin-top: auto;
}

.track-meta span {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 4px;
    color: var(--text-muted, #a0a0a0);
    font-weight: 500;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

/* Position number inline in track-meta for TOP50 */
.top50-track-card .track-meta .position-number-inline {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 4px;
    color: var(--primary-color, #4a9eff);
    font-weight: 700;
    border: 1px solid rgba(74, 158, 255, 0.3);
    font-size: 0.875rem;
}

/* Top 3 positions - special styling inline */
.top50-track-card:nth-child(1) .track-meta .position-number-inline {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: #FFD700;
    color: #1a1a1a;
    font-weight: 700;
}

.top50-track-card:nth-child(2) .track-meta .position-number-inline {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    border-color: #C0C0C0;
    color: #1a1a1a;
    font-weight: 700;
}

.top50-track-card:nth-child(3) .track-meta .position-number-inline {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    border-color: #CD7F32;
    color: white;
    font-weight: 700;
}

.track-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.track-actions audio {
    flex: 1;
    max-width: 100%;
}

.track-card .track-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: auto;
    padding-top: 0.5rem;
}

.track-card .track-actions audio {
    width: 100%;
    display: block;
}

/* Preview Player - visual indicator that it's preview only */

.track-actions .preview-player {
    width: 100% !important;
    display: block !important;
    margin-bottom: 0.5rem;
    border: 2px solid var(--primary-color, #4a9eff);
    border-radius: 8px;
    background: var(--card-bg, #2a2a2a) !important;
    padding: 0;
    box-sizing: border-box;
    height: auto;
    min-height: 44px;
    filter: brightness(1);
    overflow: hidden;
    /* Remove default browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Ensure audio controls are visible and functional - Chrome/Safari */
.track-actions .preview-player::-webkit-media-controls-panel {
    background-color: var(--card-bg, #2a2a2a) !important;
    color: var(--text-color, #e0e0e0) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
}

.track-actions .preview-player::-webkit-media-controls-enclosure {
    background-color: transparent !important;
    border-radius: 6px !important;
    padding: 0 !important;
}

.track-actions .preview-player::-webkit-media-controls-play-button {
    background-color: var(--primary-color, #4a9eff) !important;
    border-radius: 50% !important;
    color: white !important;
    filter: none !important;
    display: inline-block !important;
    width: 32px !important;
    height: 32px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.track-actions .preview-player::-webkit-media-controls-timeline {
    background-color: transparent !important;
    border-radius: 4px !important;
}

.track-actions .preview-player::-webkit-media-controls-current-time-display,
.track-actions .preview-player::-webkit-media-controls-time-remaining-display {
    color: var(--text-color, #e0e0e0) !important;
    filter: invert(0) !important;
}

/* Hide volume controls */
.track-actions .preview-player::-webkit-media-controls-volume-slider,
.track-actions .preview-player::-webkit-media-controls-mute-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Hide download/menu button (three dots) and overflow menu */
.track-actions .preview-player::-webkit-media-controls-download-button,
.track-actions .preview-player::-webkit-media-controls-overlay-enclosure,
.track-actions .preview-player::-webkit-media-controls-overlay-play-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Remove all white backgrounds from audio controls */
.track-actions .preview-player::-webkit-media-controls-enclosure {
    background-color: transparent !important;
    border-radius: 6px !important;
}

.track-actions .preview-player::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

/* Ensure no white backgrounds appear (except play button) */
.track-actions .preview-player::-webkit-media-controls-panel,
.track-actions .preview-player::-webkit-media-controls-timeline-container,
.track-actions .preview-player::-webkit-media-controls-timeline {
    background-color: transparent !important;
    background-image: none !important;
}

/* Fix rounded corners for all control elements */
.track-actions .preview-player {
    border-radius: 8px !important;
    overflow: hidden !important;
}

.track-actions .preview-player * {
    border-radius: inherit !important;
}

/* Firefox audio controls */
.track-actions .preview-player {
    background-color: var(--card-bg, #2a2a2a) !important;
    border-radius: 8px !important;
}

/* Make sure audio element is visible */
audio.preview-player {
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--card-bg, #2a2a2a) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Preview badge - positioned relative to track-actions container */
.track-actions::before {
    content: 'Preview';
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.download-button {
    padding: 0.5rem 1rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.download-button:hover {
    background: var(--btn-primary-hover, #0056b3);
}

.download-button-large {
    padding: 1rem 2rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

.download-button-large:hover {
    background: var(--primary-hover, #0056b3);
}

/* Track Page - Redesigned */
.track-page {
    width: 100%;
}

.track-main-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.track-title-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
}

.track-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-color, #e0e0e0);
    line-height: 1.2;
}

.track-brand-link {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted, #666);
}

.track-brand-link a {
    color: var(--primary-color, #007bff);
    text-decoration: none;
    transition: color 0.2s;
}

.track-brand-link a:hover {
    color: var(--primary-hover, #0056b3);
    text-decoration: underline;
}

.track-brand-link .separator {
    margin: 0 0.5rem;
    color: var(--text-muted, #999);
}

.track-player-section {
    margin-bottom: 1.25rem;
}

.audio-visualizer-container {
    width: 100%;
    height: 160px;
    margin-bottom: 1rem;
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 12px;
    padding: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
}

#audio-visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.track-player-section audio {
    width: 100%;
    border-radius: 8px;
    background: var(--card-bg, #2a2a2a) !important;
    border: 1px solid var(--border-color, #3a3a3a) !important;
    overflow: hidden;
}

.track-player-section audio::-webkit-media-controls-panel {
    background-color: var(--card-bg, #2a2a2a) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
}

.track-player-section audio::-webkit-media-controls-enclosure {
    background-color: transparent !important;
    border-radius: 6px !important;
    padding: 0 !important;
}

.track-player-section audio::-webkit-media-controls-play-button {
    background-color: var(--primary-color, #4a9eff) !important;
    border-radius: 50% !important;
    color: white !important;
    filter: none !important;
    display: inline-block !important;
    width: 32px !important;
    height: 32px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.track-player-section audio::-webkit-media-controls-timeline {
    background-color: transparent !important;
    border-radius: 4px !important;
}

.track-player-section audio::-webkit-media-controls-current-time-display,
.track-player-section audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-color, #e0e0e0) !important;
    filter: invert(0) !important;
}

.track-player-section audio::-webkit-media-controls-volume-slider,
.track-player-section audio::-webkit-media-controls-mute-button {
    filter: invert(0) !important;
    color: var(--text-color, #e0e0e0) !important;
}

/* Remove white backgrounds */
.track-player-section audio::-webkit-media-controls-panel,
.track-player-section audio::-webkit-media-controls-timeline-container,
.track-player-section audio::-webkit-media-controls-timeline {
    background-color: transparent !important;
    background-image: none !important;
}

/* Firefox audio controls */
.track-player-section audio {
    background-color: var(--card-bg, #2a2a2a) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.track-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-button-large {
    padding: 0.875rem 2rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.download-button-large:hover {
    background: var(--primary-hover, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-button {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #ddd);
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.share-button:hover {
    background: var(--hover-bg, #f5f5f5);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-button[data-share="facebook"]:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.share-button[data-share="twitter"]:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.share-button[data-share="whatsapp"]:hover {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.share-button[data-share="telegram"]:hover {
    background: #0088cc;
    color: white;
    border-color: #0088cc;
}

.share-button[data-share="copy"]:hover {
    background: var(--btn-primary-bg, #007bff);
    color: white;
    border-color: var(--btn-primary-bg, #007bff);
}

.track-info-section {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.track-rating-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color, #eee);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.rating-label {
    font-weight: 600;
    color: var(--text-color, #333);
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    color: var(--border-color, #ddd);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
}

.star.active {
    color: #ffc107;
}

.star:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-value {
    font-weight: 600;
    color: var(--text-color, #333);
    margin-left: 0.5rem;
}

.rating-count {
    color: var(--text-muted, #666);
    font-size: 0.9rem;
}

.rating-no-votes {
    color: var(--text-muted, #999);
    font-style: italic;
    font-weight: normal;
}

.rating-hint {
    color: var(--text-muted, #999);
    font-size: 0.85rem;
    margin-left: 0.5rem;
    font-style: italic;
}

.track-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: var(--text-color, #333);
    font-size: 1rem;
}

/* Notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Star hover effect */
.star.hover {
    color: #ffc107;
}

/* Responsive adjustments for track page */
@media (max-width: 768px) {
    .track-main-card {
        padding: 1.5rem;
    }

    .track-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .download-button-large {
        width: 100%;
        justify-content: center;
    }

    .share-buttons {
        justify-content: center;
    }

    .track-details-grid {
        grid-template-columns: 1fr;
    }

    .rating-display {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Search */
.search-section {
    margin: 2rem 0;
}

.search-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 1rem;
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Global Search in Header */
.global-search-container {
    margin-right: 1rem;
}

.global-search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.global-search-input {
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    width: 280px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.global-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.global-search-button {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.global-search-button:hover {
    color: #fff;
}

.global-search-button i {
    font-size: 0.9rem;
}

/* Mobile search icon button */
.global-search-icon-mobile {
    display: none;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: color 0.2s;
    align-items: center;
    justify-content: center;
}

.global-search-icon-mobile:hover {
    color: #fff;
}

/* Responsive: Hide search on mobile, show icon instead */
@media (max-width: 768px) {
    .global-search-container {
        margin-right: 0.5rem;
        position: relative;
    }

    .global-search-icon-mobile {
        display: flex;
    }

    .global-search-form {
        display: none;
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        margin-top: 0;
        background: rgba(0, 0, 0, 0.98);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        z-index: 10000;
        width: calc(100vw - 2rem);
        max-width: 500px;
        flex-direction: column;
        gap: 0.75rem;
    }

    .global-search-form.mobile-search-open {
        display: flex;
    }

    .global-search-input {
        width: 100%;
        min-width: auto;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }

    .global-search-input:focus {
        width: 100%;
    }

    .global-search-button {
        position: absolute;
        left: 0.75rem;
    }
}

@media (max-width: 480px) {
    .global-search-container {
        margin-right: 0.25rem;
    }

    .global-search-form {
        width: calc(100vw - 1rem);
        padding: 0.875rem;
    }
}

/* Language Switcher */
/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-color, #e0e0e0);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
}

.theme-toggle:hover {
    background: var(--hover-bg, #3a3a3a);
    border-color: var(--primary-color, #4a9eff);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
}

/* Иконки всегда видны, JavaScript управляет их переключением */
.theme-toggle i.fa-moon,
.theme-toggle i.fa-sun {
    display: inline-block !important;
    opacity: 1;
}

.language-switcher {
    position: relative;
}

/* Language menu overlay - always modal */
.language-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2147483646;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Language menu - centered modal */
.language-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--card-bg, #2a2a2a);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 16px;
    box-shadow: 0 12px 48px var(--shadow-color, rgba(0, 0, 0, 0.5));
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    z-index: 2147483647;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.language-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

.language-menu-header {
    display: flex;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
    justify-content: space-between;
    align-items: center;
}

.language-menu-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #e0e0e0);
}

.language-menu-close {
    background: transparent;
    border: none;
    color: var(--text-color, #e0e0e0);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.language-menu-close:hover {
    color: var(--primary-color, #4a9eff);
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 1.5rem;
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

/* Language flag styling */
.language-flag {
    font-size: 1.5rem;
    line-height: 1;
    margin-right: 0.75rem;
    display: inline-block;
    flex-shrink: 0;
}

.language-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color, #e0e0e0);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    border: 1px solid transparent;
}

.language-item:hover {
    background: var(--hover-bg, #3a3a3a);
    border-color: var(--border-color, #3a3a3a);
}

.language-item.active {
    background: var(--btn-primary-bg, #007bff);
    color: white;
    font-weight: 600;
    border-color: var(--btn-primary-bg, #007bff);
}

.language-item.active .language-flag {
    filter: brightness(1.2);
}

.language-name {
    color: inherit;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Mobile version - adjust grid and sizing */
@media (max-width: 768px) {
    .language-menu {
        width: 95% !important;
        max-width: 95% !important;
        border-radius: 16px !important;
    }

    .language-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        padding: 1rem 1.5rem 1.5rem 1.5rem !important;
    }

    .language-item {
        padding: 1rem !important;
        font-size: 0.95rem !important;
    }

    .language-flag {
        font-size: 1.5rem !important;
        margin-right: 0.875rem !important;
    }

    .language-name {
        font-size: 1rem !important;
        white-space: nowrap !important;
    }
}

.language-item {
    padding: 1.25rem 1rem !important;
    font-size: 1rem !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 60px;
    border: 1px solid var(--border-color, #3a3a3a) !important;
    background: var(--bg-color, #1a1a1a) !important;
    border-radius: 12px !important;
}

.language-item:hover {
    background: var(--hover-bg, #3a3a3a) !important;
    border-color: var(--primary-color, #4a9eff) !important;
    transform: translateX(0) scale(1);
}

.language-item.active {
    background: var(--primary-color, #4a9eff) !important;
    color: white !important;
    border-color: var(--primary-color, #4a9eff) !important;
}

.language-flag {
    font-size: 2rem !important;
    margin-right: 1rem !important;
}

.language-name {
    color: inherit !important;
    font-size: 1rem !important;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
}

.language-item.active .language-name {
    color: white !important;
    font-weight: 600;
}


/* Breadcrumbs - Modern Clean Design */
.breadcrumbs {
    background: transparent;
    /* padding: 1.25rem 0 0.5rem; */
    margin-bottom: 0;
}

.breadcrumbs ol {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs a {
    color: var(--primary-color, #007bff);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-block;
    line-height: 1.5;
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: var(--primary-hover, #0056b3);
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.625rem;
    color: var(--text-muted, #868e96);
    font-size: 0.8rem;
    user-select: none;
    font-weight: 400;
}

.breadcrumbs li:last-child a {
    color: var(--text-color, #343a40);
    font-weight: 600;
    pointer-events: none;
    text-decoration: none;
    cursor: default;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-page .button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--btn-primary-bg, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 2rem;
}

/* Intro Section */
.intro-section {
    margin-bottom: 3rem;
    text-align: center;
    padding: 2rem 0;
}

.brand-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.brand-header-logo {
    flex-shrink: 0;
    border-radius: 8px;
}

.intro-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text-color, #e0e0e0);
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-color, #e0e0e0) 0%, var(--primary-color, #5caaff) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .intro-section h1 {
        background: none;
        -webkit-text-fill-color: var(--text-color, #e0e0e0);
        color: var(--text-color, #e0e0e0);
    }
}

.intro-section .lead {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted, #b0b0b0);
}

/* Brand Description Accordion */
.brand-description-accordion {
    margin: 1.5rem 0;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.brand-description-toggle {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.brand-description-toggle:hover {
    background-color: var(--hover-bg, #f5f5f5);
}

.brand-description-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.brand-logo-small {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-short-description-inline {
    font-weight: 500;
    color: var(--text-color, #333);
    flex: 1;
}

.brand-description-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted, #666);
    flex-shrink: 0;
}

.brand-description-toggle[aria-expanded="true"] .brand-description-icon {
    transform: rotate(180deg);
}

.brand-description-content {
    padding: 0 1.5rem 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.brand-description-content:not([hidden]) {
    max-height: 2000px;
    padding: 0 1.5rem 1.5rem;
}

.brand-full-description {
    color: var(--text-color, #555);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.brand-stats {
    margin: 1rem 0;
    color: var(--text-muted, #666);
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
}

/* Category Filters - Modern Redesign */
.category-filters {
    margin: 2rem 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.category-filters h2 {
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted, #a0a0a0);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    text-decoration: none;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid var(--border-color, #3a3a3a);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    box-shadow: 0 2px 4px var(--shadow-color, rgba(0, 0, 0, 0.2));
}

.filter-btn:hover {
    background: var(--hover-bg, #3a3a3a);
    border-color: var(--primary-color, #4a9eff);
    color: var(--text-color, #e0e0e0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover, rgba(0, 0, 0, 0.3));
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--btn-primary-bg, #007bff) 0%, var(--btn-primary-hover, #0056b3) 100%);
    color: white;
    border-color: var(--primary-color, #4a9eff);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, var(--primary-hover, #6bb0ff) 0%, var(--primary-color, #4a9eff) 100%);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

/* Pagination */
.pagination-section {
    margin-top: 3rem;
    padding: 2rem 0;
    text-align: center;
}

.pagination-info {
    margin-bottom: 1.5rem;
    color: var(--text-muted, #666);
    font-size: 0.95rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-list li {
    display: flex;
    align-items: center;
}

.pagination-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color, #ddd);
    transition: all 0.2s;
    font-size: 0.95rem;
    min-width: 40px;
    justify-content: center;
}

.pagination-link:hover {
    background: var(--btn-primary-bg, #007bff);
    color: white;
    border-color: var(--btn-primary-bg, #007bff);
    transform: translateY(-1px);
}

.pagination-link.active {
    background: var(--btn-primary-bg, #007bff);
    color: white;
    border-color: var(--btn-primary-bg, #007bff);
}

/* Pagination items for hub */
.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color, #3a3a3a);
    transition: all 0.2s;
    font-size: 0.95rem;
    min-width: 40px;
    margin: 0 0.25rem;
}

.pagination-item:hover {
    background: var(--primary-color, #4a9eff);
    color: white;
    border-color: var(--primary-color, #4a9eff);
    transform: translateY(-1px);
}

.pagination-item.active {
    background: var(--primary-color, #4a9eff);
    color: white;
    border-color: var(--primary-color, #4a9eff);
}

.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    color: var(--text-muted, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
}


.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--text-muted, #666);
}

.pagination-prev,
.pagination-next {
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {

    .brands-grid,
    .devices-grid,
    .tracks-grid {
        grid-template-columns: 1fr;
    }

    /* TOP50 Mobile Styles */
    .top50-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .top50-intro h1 {
        font-size: 2rem;
    }

    .intro-section {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    
    .intro-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .intro-section .lead {
        font-size: 1.1rem;
    }



    .top50-logo-img {
        width: 80px;
        height: 80px;
    }

    .top50-sort-selector {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .sort-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sort-button {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
    }

    .search-form {
        flex-direction: column;
    }

    .track-actions {
        flex-direction: column;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
    }
}

/* FAQ Page Styles */
.faq-intro {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color, #3a3a3a);
    color: var(--text-color, #e0e0e0);
}

.faq-section {
    margin: 3rem 0;
}

.faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text-color, #e0e0e0);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color, #3a3a3a);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    /* padding: 1.5rem; */
    border: 1px solid var(--border-color, #3a3a3a);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 4px 12px var(--shadow-color, rgba(0, 0, 0, 0.3));
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 600;
    /* margin: 0 0 1rem 0; */
    color: var(--text-color, #e0e0e0);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.faq-number {
    color: var(--primary-color, #4a9eff);
    font-weight: 700;
    flex-shrink: 0;
}

.faq-answer {
    color: var(--text-muted, #a0a0a0);
    line-height: 1.8;
    margin-top: 0.5rem;
}

.faq-answer p {
    margin: 0.5rem 0;
}

/* Installation Guide Styles */
.installation-guide {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color, #3a3a3a);
}

.guide-step {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(74, 158, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color, #4a9eff);
}

.guide-step:first-child {
    margin-top: 0;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.guide-step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-color, #e0e0e0);
}

.guide-step h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-color, #e0e0e0);
}

.guide-step p {
    color: var(--text-muted, #a0a0a0);
    line-height: 1.8;
    margin: 0.5rem 0;
}

.guide-step ol,
.guide-step ul {
    margin: 1rem 0;
    padding-left: 2rem;
    color: var(--text-muted, #a0a0a0);
    line-height: 1.8;
}

.guide-step li {
    margin: 0.5rem 0;
}

.guide-step strong {
    color: var(--text-color, #e0e0e0);
    font-weight: 600;
}

.guide-note {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.guide-note p {
    margin: 0;
    color: var(--text-color, #e0e0e0);
    line-height: 1.8;
}

.guide-note strong {
    color: #ffc107;
}

@media (max-width: 768px) {
    .faq-section h2 {
        font-size: 1.5rem;
    }

    .faq-question {
        font-size: 1.1rem;
    }

    .installation-guide {
        padding: 1.5rem;
    }

    .guide-step {
        padding: 1rem;
    }

    .guide-step h3 {
        font-size: 1.25rem;
    }

    .guide-step h4 {
        font-size: 1.1rem;
    }
}

/* Footer Disclaimer Styles */
.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color, #3a3a3a);
    margin-top: 2rem;
}

.footer-bottom p {
    margin: 0.5rem 0;
    color: var(--text-muted, #a0a0a0);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-disclaimer {
    font-size: 0.85rem !important;
    color: var(--text-muted, #a0a0a0) !important;
    max-width: 900px;
    margin: 1rem auto 0 !important;
    padding: 0 1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .footer-disclaimer {
        font-size: 0.8rem !important;
        padding: 0 0.5rem;
    }
}

/* ========================================
   Ringtone Hub Styles
   ======================================== */

.hub-header {
    text-align: center;
    margin: 1rem 0 1rem;
}

.hub-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hub-actions {
    margin-top: 1.5rem;
}

.hub-actions .btn-primary,
.hub-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin: 0 0.5rem;
}

.section-header .hub-actions {
    margin-top: 0;
    margin-left: auto;
}

.hub-upload-section {
    margin: 3rem 0;
}

.upload-card {
    background: var(--card-bg, #2a2a2a);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color, #3a3a3a);
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
    margin-bottom: 2rem;
}

.upload-card h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--text-color, #e0e0e0);
}

.editor-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-color, #e0e0e0);
}

.upload-area {
    border: 2px dashed var(--border-color, #3a3a3a);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color, #4a9eff);
    background: var(--hover-bg, #3a3a3a);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color, #4a9eff);
    margin-bottom: 1rem;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color, #4a9eff);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.upload-button:hover {
    background: var(--primary-hover, #6bb0ff);
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--hover-bg, #3a3a3a);
    border-radius: 8px;
    margin-top: 1rem;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.remove-file-btn {
    background: transparent;
    border: none;
    color: var(--text-color, #e0e0e0);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.remove-file-btn:hover {
    background: rgba(255, 0, 0, 0.2);
}

/* YouTube Upload Styles */
.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color, #3a3a3a);
}

.upload-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted, #b0b0b0);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-tab:hover {
    color: var(--text-color, #e0e0e0);
}

.upload-tab.active {
    color: var(--primary-color, #4a9eff);
    border-bottom-color: var(--primary-color, #4a9eff);
}

.upload-tab-content {
    display: none;
}

.upload-tab-content.active {
    display: block;
}

.youtube-upload-form {
    padding: 1rem 0;
}

.youtube-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.youtube-url-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 8px;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    font-size: 1rem;
}

.youtube-url-input:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.youtube-download-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.youtube-hint {
    font-size: 0.85rem;
    color: var(--text-muted, #b0b0b0);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.youtube-status {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--hover-bg, #3a3a3a);
    border-radius: 8px;
}

.youtube-status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color, #e0e0e0);
}

.youtube-progress {
    margin-top: 0.75rem;
    height: 4px;
    background: var(--card-bg, #2a2a2a);
    border-radius: 2px;
    overflow: hidden;
}

.youtube-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, #4a9eff), #5ab0ff, var(--primary-color, #4a9eff));
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 2px;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.audio-editor-section {
    margin: 3rem 0;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Waveform Section */
.waveform-section {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #3a3a3a);
}

#waveform {
    margin: 0;
    background: var(--preview-bg, #1f1f2e);
    border-radius: 8px;
    padding: 1rem;
    min-height: 120px;
}

.time-display {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color, #e0e0e0);
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg, #2a2a2a);
    border-radius: 10px;
    border: 1px solid var(--border-color, #3a3a3a);
    flex-wrap: wrap;
}

.controls-row:not(:last-child) {
    margin-bottom: 0;
}

.main-controls {
    justify-content: center;
    gap: 0.75rem;
}

.view-controls {
    justify-content: flex-start;
    gap: 2rem;
}

@media (min-width: 768px) {
    .view-controls {
        justify-content: space-between;
    }
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color, #e0e0e0);
    white-space: nowrap;
    margin: 0;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0; /* Allow text truncation if needed */
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-primary {
    background: var(--primary-color, #4a9eff);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover, #6bb0ff);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    border: 1px solid var(--border-color, #3a3a3a);
}

.btn-secondary:hover {
    background: var(--hover-bg, #3a3a3a);
}

/* Trim Controls */
.trim-controls {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 1.5rem;
}

.trim-controls .control-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.time-input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    background: var(--input-bg, #1f1f1f);
    color: var(--text-color, #e0e0e0);
    width: 110px;
    font-size: 0.95rem;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.end-time-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.duration-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #b0b0b0);
    white-space: nowrap;
}

.crop-button {
    margin-left: auto;
    align-self: flex-end;
    min-width: 120px;
}

/* Fade Controls */
.fade-controls {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 1.5rem;
}

.fade-controls .control-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.fade-input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    background: var(--input-bg, #1f1f1f);
    color: var(--text-color, #e0e0e0);
    width: 100px;
    font-size: 0.95rem;
}

.fade-input:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.preview-button {
    margin-left: auto;
    align-self: flex-end;
    min-width: 120px;
}

.ringtone-author {
    color: var(--text-muted, #b0b0b0);
    font-size: 0.9rem;
    margin: 0.25rem 0;
    font-style: italic;
}

/* Zoom Controls */
.zoom-buttons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--input-bg, #1f1f1f);
    padding: 0.25rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #3a3a3a);
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color, #4a9eff);
    font-size: 0.95rem;
    padding: 0 0.5rem;
}

.speed-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    background: var(--input-bg, #1f1f1f);
    color: var(--text-color, #e0e0e0);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 100px;
}

.speed-select:hover {
    border-color: var(--primary-color, #4a9eff);
}

.speed-select:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Additional spacing improvements */
.controls-section {
    margin-top: 0.5rem;
}

.publish-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color, #3a3a3a);
}

.btn-icon {
    background: var(--button-bg, #3a3a3a);
    border: 1px solid var(--border-color, #4a4a4a);
    color: var(--text-color, #e0e0e0);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--button-hover-bg, #4a4a4a);
    border-color: var(--primary-color, #4a9eff);
    z-index: 2;
}

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

.btn-icon:focus {
    outline: 2px solid var(--primary-color, #4a9eff);
    outline-offset: 2px;
}

/* Waveform container for zoom */
#waveform {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
}

#waveform:active {
    cursor: grabbing;
}

/* Responsive Design */
@media (max-width: 768px) {
    .editor-controls {
        gap: 1rem;
    }
    
    .waveform-section {
        padding: 1rem;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }
    
    .view-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .trim-controls,
    .fade-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .trim-controls .control-group,
    .fade-controls .control-group {
        width: 100%;
    }
    
    .crop-button,
    .preview-button {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .time-input,
    .fade-input {
        width: 100%;
    }
    
    .zoom-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .main-controls {
        justify-content: stretch;
    }
    
    .main-controls .btn-primary,
    .main-controls .btn-secondary {
        flex: 1;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.65rem 0.75rem;
        min-width: 0; /* Allow buttons to shrink */
        white-space: normal; /* Allow text wrapping */
        word-break: break-word;
        line-height: 1.3;
    }
    
    /* Hide text on very small screens, show only icons */
    @media (max-width: 479px) {
        .main-controls .btn-primary span,
        .main-controls .btn-secondary span {
            display: none;
        }
        
        .main-controls .btn-primary,
        .main-controls .btn-secondary {
            min-width: 44px; /* Minimum touch target */
            padding: 0.75rem;
            justify-content: center;
        }
        
        .main-controls .btn-primary i,
        .main-controls .btn-secondary i {
            margin: 0;
        }
    }
    
    /* Show text with smaller font on small tablets */
    @media (min-width: 480px) and (max-width: 767px) {
        .main-controls .btn-primary,
        .main-controls .btn-secondary {
            font-size: 0.7rem;
            padding: 0.6rem 0.4rem;
            white-space: normal;
            line-height: 1.2;
        }
    }
}

.publish-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 8px;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-publish {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
}

.hub-community-section {
    margin: 1rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header .hub-actions {
    margin-top: 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-form input[type="text"],
.search-form select {
    padding: 0.5rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
}

.search-form button {
    padding: 0.5rem 1rem;
    background: var(--primary-color, #4a9eff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.ringtones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.ringtone-card {
    background: var(--card-bg, #2a2a2a);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #3a3a3a);
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.ringtone-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-hover, rgba(0, 0, 0, 0.4));
}

.ringtone-player {
    margin-bottom: 1rem;
    position: relative;
}

.waveform-wrapper {
    width: 100%;
    height: 60px;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg, #1a1a1a);
    /* Используем grid, чтобы картинка и оверлей занимали ровно одну и ту же область */
    display: grid;
    place-items: stretch;
}

.waveform-wrapper .static-wave {
    display: block;
    width: 100%;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    user-select: none;
    grid-area: 1 / 1;
}

.waveform-wrapper .ringtone-waveform {
    margin-bottom: 0;
    border-radius: 0;
    background: transparent;
}

/* Overlay tracker (progress fill + playhead) shown during playback */
.active-waveform {
    grid-area: 1 / 1;
    position: relative;
    pointer-events: none;
    z-index: 1; /* выше картинки за счёт порядка в DOM */
}

.active-waveform .waveform-progress {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0%;
    height: 4px; /* тонкая полоска ровно по линии волны */
    background: rgba(0, 0, 0, 0.45);
    border-radius: 2px;
}

.active-waveform .waveform-playhead {
    position: absolute;
    top: 10%;
    left: 0%;
    height: 100%;
    width: 1px;
    background: #004184; /* ярко‑жёлтый маркер */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    outline: 1px solid #0079f8;
}

.waveform-wrapper.modal-waveform-wrapper {
    height: 120px;
    min-height: 120px;
    /* Используем grid, чтобы картинка и оверлей занимали ровно одну и ту же область */
    display: grid;
    place-items: stretch;
}

.waveform-wrapper.modal-waveform-wrapper .static-wave {
    height: 120px;
    grid-area: 1 / 1;
}

.waveform-wrapper.modal-waveform-wrapper .ringtone-modal-waveform {
    margin-bottom: 0;
    border-radius: 0;
    background: transparent;
    grid-area: 1 / 1;
}

.ringtone-waveform {
    width: 100%;
    height: 60px;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg, #1a1a1a);
    position: relative;
    min-height: 60px;
}

.ringtone-waveform canvas {
    display: block;
    width: 100% !important;
    height: 60px !important;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn i {
    position: relative;
    z-index: 2;
}

.play-btn-progress {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: rotate(-90deg);
}

.play-btn-progress-bg {
    fill: #004288;
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 2;
}

.play-btn-progress-circle {
    fill: none;
    stroke: #007bff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 0 999;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

.play-btn:hover {
    background: var(--primary-hover, #6bb0ff);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ringtone-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.ringtone-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted, #b0b0b0);
    margin-bottom: 1rem;
}

.ringtone-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

.ringtone-actions .download-btn {
    margin-left: auto;
}

.vote-buttons {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.20rem;
    padding: 0.4rem 0.4rem;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 6px;
    background: var(--card-bg, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    background: var(--hover-bg, #3a3a3a);
}

.vote-btn.active {
    background: var(--primary-color, #4a9eff);
    color: white;
    border-color: var(--primary-color, #4a9eff);
}

.vote-btn.upvote.active {
    background: #4caf50;
    border-color: #4caf50;
}

.vote-btn.downvote.active {
    background: #f44336;
    border-color: #f44336;
}

.download-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.download-format-dropdown {
    position: relative;
}

.download-btn.download-format-toggle {
    padding: 0.4rem 0.4rem;
    background: var(--primary-color, #4a9eff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
    text-decoration: none;
    font-size: 1em;
    font-family: inherit;
}

.download-btn.download-format-toggle:hover {
    background: var(--primary-hover, #6bb0ff);
}

.download-btn.download-format-toggle .download-chevron {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.download-format-dropdown[aria-expanded="true"] .download-btn.download-format-toggle {
    background: var(--primary-hover, #6bb0ff);
}

.download-format-dropdown[aria-expanded="true"] .download-btn.download-format-toggle .download-chevron {
    transform: rotate(180deg);
}

.download-format-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.download-format-dropdown[aria-expanded="true"] .download-format-menu,
.download-format-menu.show {
    display: block;
}

.download-format-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid var(--border-color, #e9ecef);
    font-weight: 500;
}

.download-format-option:last-child {
    border-bottom: none;
}

.download-format-option:hover {
    background: var(--hover-bg, #f8f9fa);
    color: var(--primary-color, #4a9eff);
}

.download-format-option:focus {
    background: var(--hover-bg, #f8f9fa);
    color: var(--primary-color, #4a9eff);
    outline: 2px solid var(--primary-color, #4a9eff);
    outline-offset: -2px;
}

.download-format-option i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .download-format-menu {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .download-format-option {
        color: #e9ecef;
        border-bottom-color: #404040;
    }
    
    .download-format-option:hover,
    .download-format-option:focus {
        background: #3a3a3a;
        color: #6bb0ff;
    }
}

@media (max-width: 768px) {
    .download-wrapper {
        flex-direction: column;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .download-format-toggle {
        width: 100%;
    }
    
    .download-format-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
}

.ringtone-share-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
}

.share-buttons,
.search-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.share-buttons:last-child,
.search-buttons:last-child {
    margin-bottom: 0;
}

.share-btn,
.search-btn {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--card-bg, #2a2a2a) 0%, var(--hover-bg, #3a3a3a) 100%);
    color: var(--text-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn::before,
.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.share-btn:hover,
.search-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: transparent;
}

.share-btn:hover i,
.search-btn:hover i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.share-btn i,
.search-btn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.share-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border-color: #25D366;
}

.share-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.share-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
    color: white;
    border-color: #0088cc;
}

.share-telegram:hover {
    background: linear-gradient(135deg, #005f8c 0%, #0088cc 100%);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.share-facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0d5fbf 100%);
    color: white;
    border-color: #1877F2;
}

.share-facebook:hover {
    background: linear-gradient(135deg, #0d5fbf 0%, #1877F2 100%);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4);
}

.share-reddit {
    background: linear-gradient(135deg, #FF4500 0%, #cc3700 100%);
    color: white;
    border-color: #FF4500;
}

.share-reddit:hover {
    background: linear-gradient(135deg, #cc3700 0%, #FF4500 100%);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

.share-twitter {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border-color: #000000;
}

.share-twitter:hover {
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.share-copy {
    background: linear-gradient(135deg, var(--primary-color, #4a9eff) 0%, var(--primary-hover, #6bb0ff) 100%);
    color: white;
    border-color: var(--primary-color, #4a9eff);
}

.share-copy:hover {
    background: linear-gradient(135deg, var(--primary-hover, #6bb0ff) 0%, var(--primary-color, #4a9eff) 100%);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.search-spotify {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
    color: white;
    border-color: #1DB954;
}

.search-spotify:hover {
    background: linear-gradient(135deg, #1ed760 0%, #1DB954 100%);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

.search-youtube {
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%);
    color: white;
    border-color: #FF0000;
}

.search-youtube:hover {
    background: linear-gradient(135deg, #cc0000 0%, #FF0000 100%);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.search-apple {
    background: linear-gradient(135deg, #FA243C 0%, #c81d2f 100%);
    color: white;
    border-color: #FA243C;
}

.search-apple:hover {
    background: linear-gradient(135deg, #c81d2f 0%, #FA243C 100%);
    box-shadow: 0 6px 20px rgba(250, 36, 60, 0.4);
}

.search-deezer {
    background: linear-gradient(135deg, #FEAA2D 0%, #cc8800 100%);
    color: white;
    border-color: #FEAA2D;
}

.search-deezer:hover {
    background: linear-gradient(135deg, #cc8800 0%, #FEAA2D 100%);
    box-shadow: 0 6px 20px rgba(254, 170, 45, 0.4);
}

.search-yandex {
    background: linear-gradient(135deg, #FC3F1D 0%, #c93216 100%);
    color: white;
    border-color: #FC3F1D;
}

.search-yandex:hover {
    background: linear-gradient(135deg, #c93216 0%, #FC3F1D 100%);
    box-shadow: 0 6px 20px rgba(252, 63, 29, 0.4);
}

.search-tidal {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    border-color: #000000;
}

.search-tidal:hover {
    background: linear-gradient(135deg, #333333 0%, #000000 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted, #b0b0b0);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .ringtones-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-form select,
    .search-form button {
        width: 100%;
    }
    
    .share-buttons,
    .search-buttons {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .share-btn,
    .search-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Screen reader only - for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Highlighted ringtone card */
.ringtone-card-highlighted {
    border: 2px solid var(--primary-color, #4a9eff) !important;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5) !important;
    animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(74, 158, 255, 0.8);
    }
}

/* Ringtone Modal */
.ringtone-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ringtone-modal[style*="display: flex"] {
    opacity: 1;
    pointer-events: all;
}

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

.ringtone-modal-content {
    position: relative;
    background: var(--card-bg, #2a2a2a);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color, #3a3a3a);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 10001;
}

.ringtone-modal[style*="display: flex"] .ringtone-modal-content {
    transform: scale(1);
}

.ringtone-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--hover-bg, #3a3a3a);
    color: var(--text-color, #e0e0e0);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10002;
}

.ringtone-modal-close:hover {
    background: var(--primary-color, #4a9eff);
    color: white;
    transform: rotate(90deg);
}

.ringtone-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #3a3a3a);
}

.ringtone-modal-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color, #e0e0e0);
}

.ringtone-modal-author {
    margin: 0;
    color: var(--text-muted, #b0b0b0);
    font-size: 1rem;
}

.ringtone-modal-player {
    position: relative;
    margin-bottom: 1.5rem;
}

.ringtone-modal-waveform {
    width: 100%;
    height: 120px;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    position: relative;
    min-height: 120px;
    display: block;
    z-index: 1;
}

.ringtone-modal-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color, #4a9eff);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ringtone-modal-play-btn:hover {
    background: var(--primary-hover, #6bb0ff);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.ringtone-modal-info {
    text-align: center;
}

.ringtone-modal-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted, #b0b0b0);
}

.ringtone-modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ringtone-modal-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ringtone-modal-share {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #3a3a3a);
}

.ringtone-modal-share .share-buttons,
.ringtone-modal-share .search-buttons {
    justify-content: center;
}

@media (max-width: 768px) {
    .ringtone-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .ringtone-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .ringtone-modal-waveform {
        height: 100px;
    }
    
    .ringtone-modal-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}