/* MuzRich - Telegram Web App Style (800px Max Width) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #000000;
    background: #f0f0f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: 56px;
}

button, input {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;	
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e1e1e1;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: #0088cc;
    text-decoration: none;
}

.header-title:hover {
    color: #0077b3;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0088cc;
    cursor: pointer;
    font-size: 18px;
}

.header-btn:hover {
    background: #f0f0f0;
}

/* Search Panel */
.search-panel {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    border-bottom: 1px solid #e1e1e1;
    padding: 12px 16px;
    transition: transform 0.3s ease;
    z-index: 99;
}

.search-panel.active {
    transform: translateX(-50%) translateY(0);
}

.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 10px 16px;
}

.search-icon {
    color: #8e8e93;
    margin-right: 8px;
    font-size: 16px;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #000000;
}

.search-input::placeholder {
    color: #8e8e93;
}

.search-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #8e8e93;
    cursor: pointer;
    display: none;
    font-size: 14px;
}

.search-close.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main {
    padding-top: 56px;
    min-height: 100vh;
}

/* Categories */
.categories {
    display: flex;
    padding: 16px;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #000000;
    min-width: 70px;
    padding: 12px 8px;
}

.category-icon {
    font-size: 24px;
    margin-bottom: 6px;
    color: #0088cc;
}

.category-item span {
    font-size: 14px;
    text-align: center;
    color: #8e8e93;
}

.category-item:hover span {
    color: #0088cc;
}

/* Sections */
.section {
    margin-bottom: 24px;
}

.section-header {
    padding: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
}

.page-header {
    padding: 24px 16px;
    text-align: center;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #000000;
}

/* Featured Tracks */
.featured-tracks {
    display: flex;
    gap: 20px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.featured-tracks::-webkit-scrollbar {
    display: none;
}

.featured-card {
    flex: none;
    width: 140px;
    background: #ffffff;
    text-decoration: none;
    color: #000000;
    display: block;
}

.featured-image {
    width: 140px;
    height: 140px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.featured-card:active .featured-overlay {
    opacity: 1;
}

.play-overlay {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0088cc;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.featured-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-subtitle {
    font-size: 12px;
    color: #8e8e93;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Track List */
.track-list {
    background: #ffffff;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #000000;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.track-item:last-child {
    border-bottom: none;
}

.track-item:hover {
    background: #f8f8f8;
}

.track-item.active {
    background: #f8f8f3;
}

.track-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 12px;
}

.track-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-icon {
    font-size: 20px;
    color: #8e8e93;
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-subtitle {
    font-size: 14px;
    color: #8e8e93;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-duration {
    font-size: 14px;
    color: #8e8e93;
    min-width: 40px;
    text-align: right;
}

.action-btn {
	width: 32px;
	height: 32px;
    border: none;
    background: none;
    color: #8e8e93;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.action-btn:hover {
    background: #f0f0f0;
    color: #0088cc;
}

.track-number {
    font-size: 14px;
    font-weight: 500;
    color: #8e8e93;
    min-width: 24px;
    text-align: center;
    margin-right: 8px;
}

/* Player */
.player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 100%;
    max-width: 800px;
    height: 72px;
    background: #ffffff;
    border-top: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    transition: transform 0.3s ease;
    z-index: 200;
}

.player.active {
    transform: translateX(-50%) translateY(0);
}

.player-track {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.player .track-avatar {
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

.player .music-icon {
    font-size: 16px;
}

.player .track-title {
    font-size: 15px;
}

.player .track-subtitle {
    font-size: 14px;
}

.player-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #0088cc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.control-btn:hover {
    background: #f0f0f0;
}

.control-btn.primary {
    background: #0088cc;
    color: #ffffff;
}

.control-btn.primary:hover {
    background: #0077b3;
}

.player-extra {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-info {
    font-size: 12px;
    color: #8e8e93;
    white-space: nowrap;
}

.time-separator {
    margin: 0 2px;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 100%;
    max-width: 800px;
    height: 8px;
    background: #e1e1e1;
    transition: transform 0.3s ease;
    z-index: 199;
}

.progress-container.active {
    transform: translateX(-50%) translateY(0);
}

.progress-bar {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: #0088cc;
    width: 0%;
    transition: width 0.1s linear;
}

/* Base Styles */
.bottom-nav {
    margin-bottom: 20px;
    padding: 20px 0;
    background: white;
    clear: both;
}

.pagi-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Page Numbers & Links */
.navigation span,
.navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    line-height: 1;
    position: relative;
    box-sizing: border-box;
}

/* Current Page (Active) */
.navigation span {
    background: #4a5568;
    color: white;
    border-color: #4a5568;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 4px rgba(74, 85, 104, 0.2);
}

/* Other Pages */
.navigation a {
    background: white;
    color: #4a5568;
    border-color: #e2e8f0;
    font-weight: 500;
}

.navigation a:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navigation a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navigation a:focus {
    outline: 2px solid #4a5568;
    outline-offset: 2px;
}

/* Dots/Ellipsis */
.navigation .nav_ext {
    background: transparent !important;
    border: none !important;
    color: #a0aec0;
    cursor: default;
    min-width: 30px;
    font-weight: 600;
    font-size: 16px;
}

.navigation .nav_ext:hover {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Previous/Next Buttons (if needed) */
.pnext,
.pprev {
    margin: 0 8px;
}

.pnext a,
.pprev a {
    background: #4a5568;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pnext a:hover,
.pprev a:hover {
    background: #2d3748;
    transform: scale(1.05);
}

/* Utility Classes */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.clr {
    clear: both;
}

.ignore-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Alternative Styles */

/* Rounded Style */
.pagination-rounded .navigation span,
.pagination-rounded .navigation a {
    border-radius: 50%;
    min-width: 40px;
    width: 40px;
    padding: 0;
}

/* Large Style */
.pagination-large .navigation span,
.pagination-large .navigation a {
    min-width: 48px;
    height: 48px;
    font-size: 16px;
    padding: 10px 14px;
}

/* Small Style */
.pagination-small .navigation span,
.pagination-small .navigation a {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 6px 10px;
}

/* Minimal Style */
.pagination-minimal .navigation span,
.pagination-minimal .navigation a {
    border: none;
    background: transparent;
    color: #4a5568;
}

.pagination-minimal .navigation span {
    background: #4a5568;
    color: white;
}

.pagination-minimal .navigation a:hover {
    background: #f7fafc;
}

/* Bordered Style */
.pagination-bordered {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #f8f9fa;
}

/* Color Variants */

/* Blue Theme */
.pagination-blue .navigation span {
    background: #3182ce;
    border-color: #3182ce;
}

.pagination-blue .navigation a:hover {
    border-color: #3182ce;
    color: #3182ce;
}

/* Green Theme */
.pagination-green .navigation span {
    background: #38a169;
    border-color: #38a169;
}

.pagination-green .navigation a:hover {
    border-color: #38a169;
    color: #38a169;
}

/* Red Theme */
.pagination-red .navigation span {
    background: #e53e3e;
    border-color: #e53e3e;
}

.pagination-red .navigation a:hover {
    border-color: #e53e3e;
    color: #e53e3e;
}

/* Icon Placeholder */
.icon-placeholder {
    font-size: 20px;
    color: #8e8e93;
}

/* Beautiful Buttons */
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4) !important;
}

a[download]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

/* Fullstory Beautiful Play Button */
.fullstory-play-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 136, 204, 0.5), 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

.fullstory-play-btn:hover .shine-effect {
    left: 100% !important;
}

.fullstory-play-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.fullstory-play-btn.playing {
    background: linear-gradient(135deg, #ff6b35, #f7931e, #ffcc02) !important;
    animation: pulse 2s infinite;
}

.fullstory-play-btn.playing .play-icon-container {
    animation: spin 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6), 0 4px 12px rgba(0, 0, 0, 0.2); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utils */
.hidden {
    display: none !important;
}

/* Responsive */
@media (min-width: 480px) {
    .categories {
        justify-content: center;
    }
    
    .featured-tracks {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .featured-card {
        width: 200px;
    }
    
    .featured-image {
        width: 200px;
        height: 200px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    body {
        background: #2c2c2e;
        color: #ffffff;
    }
    
    .container {
        background: #1c1c1e;
    }
    
    .header {
        background: #1c1c1e;
        border-bottom-color: #38383a;
    }
    
    .search-panel {
        background: #1c1c1e;
        border-bottom-color: #38383a;
    }
    
    .search-input-wrapper {
        background: #38383a;
    }
    
    .search-input {
        color: #ffffff;
    }
    
    .track-list {
        background: #1c1c1e;
    }
    
    .track-item {
        border-bottom-color: #38383a;
    }
    
    .track-item:hover {
        background: #2c2c2e;
    }
    
    .track-avatar {
        background: #38383a;
    }
    
    .player {
        background: #1c1c1e;
        border-top-color: #38383a;
    }
    
    .progress-container {
        background: #38383a;
    }
    
    .header-title,
    .section-header h2,
    .page-header h1,
    .track-title {
        color: #ffffff;
    }
    
    .featured-card {
        background: #1c1c1e;
    }
}

/* Mobile adjustments */
@media (max-width: 800px) {
    .container {
        max-width: 100vw;
    }
    
    .header {
        max-width: 100vw;
    }
    
    .search-panel {
        max-width: 100vw;
    }
    
    .player {
        max-width: 100vw;
    }
    
    .progress-container {
        max-width: 100vw;
    }
}

/* iOS Safari adjustments */
@supports (-webkit-touch-callout: none) {
    body {
        padding-bottom: max(100px, env(safe-area-inset-bottom));
    }
    
    .main {
        padding-top: max(56px, env(safe-area-inset-top));
    }
    
    .header {
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }
    
    .player {
        padding-bottom: env(safe-area-inset-bottom);
    }
}