/**
 * Frequency Relax - Main App Styles
 * Mobile-first design with glassmorphism
 */

/* ==================== Variables - Galassia Cristallina ==================== */
:root {
    --primary: #3399ff;
    --primary-dark: #0a1929;
    --secondary: #66b2ff;
    --accent: #99ccff;
    --success: #66b2ff;
    --warning: #ff9800;
    --danger: #f44336;

    --bg-dark: #0a1929;
    --bg-dark-alt: #132f4c;
    --bg-card: rgba(19, 47, 76, 0.7);

    --text-primary: #ffffff;
    --text-secondary: #b2bac2;
    --text-muted: #8796a5;

    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 60px;
    --footer-height: 70px;
}

/* ==================== Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1e4976 0%, #132f4c 50%, #0a1929 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== App Header ==================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 20px;
    z-index: 1000;
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.app-title {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.title-prosa {
    font-size: 40px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.title-frequenza {
    font-size: 30px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 2px;
}

@media (max-width: 480px) {
    .app-logo {
        width: 36px;
        height: 36px;
    }

    .title-prosa {
        font-size: 36px;
    }

    .title-frequenza {
        font-size: 26px;
    }
}

/* ==================== Footer Navigation ==================== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
}

.footer-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    font-size: 0.7rem;
    font-weight: 500;
}

.footer-nav-item:hover {
    color: var(--text-secondary);
}

.footer-nav-item.active {
    color: var(--text-primary);
}

.footer-nav-item .nav-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    transition: var(--transition);
}

.footer-nav-item.active .nav-icon {
    transform: scale(1.1);
}

.footer-nav-item span {
    font-family: 'Poppins', sans-serif;
}

/* ==================== Main Content ==================== */
.main-content {
    margin-top: var(--header-height);
    padding: 8px;
    padding-bottom: calc(var(--footer-height) + 16px);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 22px;
    height: 22px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.card-body {
    color: var(--text-secondary);
}

/* ==================== Dashboard Grid ==================== */
.dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-wide {
        grid-column: span 2;
    }
}

/* License Card */
.license-type-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
    background: rgba(51, 153, 255, 0.2);
    color: var(--primary);
}

.license-type-badge.premium {
    background: rgba(102, 178, 255, 0.2);
    color: var(--secondary);
}

.license-type-badge.base {
    background: rgba(51, 153, 255, 0.2);
    color: var(--primary);
}

.license-days {
    font-size: 1rem;
    color: var(--text-secondary);
    /* margin-bottom: 8px; */
}

.license-user {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.license-bonus {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.bonus-count.success {
    color: var(--success);
    font-weight: 600;
}

/* Frequency Count */
.frequency-count {
    text-align: center;
    padding: 20px 0;
}

.count-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.count-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.frequency-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.frequency-chip {
    padding: 6px 12px;
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
}

/* App Info */
.app-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.info-icon {
    width: 24px;
    height: 24px;
    stroke: var(--secondary);
    flex-shrink: 0;
}

/* ==================== Account Screen ==================== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Referral Code */
.referral-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.referral-code-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.referral-code {
    flex: 1;
    background: rgba(0, 206, 201, 0.1);
    border: 2px solid var(--secondary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 2px;
}

.btn-copy {
    padding: 12px 24px;
    background: var(--secondary);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.btn-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.btn-logout {
    padding: 16px 48px;
    background: rgba(214, 48, 49, 0.1);
    border: 2px solid var(--danger);
    border-radius: var(--border-radius-sm);
    color: var(--danger);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
}

.logout-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== Frequency List & Player ==================== */
.frequency-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.frequency-item {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.frequency-item:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
    transform: translateX(4px);
}

.frequency-item.active {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.2);
}

.frequency-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.frequency-item.disabled:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--bg-card);
}

.frequency-info {
    flex: 1;
}

.frequency-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.frequency-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.frequency-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(51, 153, 255, 0.2);
    color: var(--primary);
}

.frequency-badge.premium {
    background: rgba(102, 178, 255, 0.2);
    color: var(--secondary);
}

/* Audio Player */
.audio-player {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-top: 20px;
}

.player-header {
    margin-bottom: 24px;
}

.frequency-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.frequency-description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Duration Control */
.duration-control {
    margin-bottom: 24px;
}

.duration-control label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.duration-control strong {
    color: var(--primary);
}

.duration-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.duration-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.duration-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.duration-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-control {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.2);
    border: 2px solid var(--primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-control svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.btn-control:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.btn-play {
    width: 64px;
    height: 64px;
}

.btn-play svg {
    width: 28px;
    height: 28px;
}

.btn-stop {
    background: rgba(214, 48, 49, 0.2);
    border-color: var(--danger);
}

.btn-stop:hover {
    background: var(--danger);
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.time-current,
.time-total {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-icon {
    font-size: 1.2rem;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
}

.volume-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

/* ==================== Statistics Screen ==================== */
.stat-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dashboard Frequency Breakdown */
.frequency-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.breakdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.breakdown-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    stroke: var(--primary);
    opacity: 0.7;
}

.breakdown-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breakdown-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 28px;
    text-align: right;
}

.weekly-chart {
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
}

.frequency-usage h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.usage-item:last-child {
    border-bottom: none;
}

.usage-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.usage-count {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* ==================== Responsive Design ==================== */
@media (min-width: 768px) {
    .main-content {
        padding: 32px;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* ============================================
   MARKET SECTION (v2.0)
   ============================================ */

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-badge {
    position: relative;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}

.cart-badge:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.cart-badge svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.cart-count.warning {
    background: var(--warning);
    color: white;
}

.market-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.market-tab {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.market-tab:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.market-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Market Section Title */
.market-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Filters (Thematic) */
.market-category-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.category-filter {
    background: rgba(25, 55, 85, 0.4);
    border: 1px solid rgba(10, 25, 41, 0.6);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-filter:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(25, 55, 85, 0.6);
}

.category-filter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.market-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 100px;
}

.product-card {
    background: rgba(25, 55, 85, 0.6);
    border: 1px solid rgba(10, 25, 41, 0.8);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-card:hover {
    transform: translateY(-4px);
    background: rgba(25, 55, 85, 0.8);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.product-info h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-type {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.product-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.product-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--accent);
    color: white;
    margin-right: 8px;
}

.product-license-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-license-badge.free {
    background: #4CAF50;
    color: white;
}

.product-license-badge.base {
    background: #2196F3;
    color: white;
}

.product-license-badge.premium {
    background: #FF9800;
    color: white;
}

.product-license-badge.elite {
    background: #9C27B0;
    color: white;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-add-cart {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-cart:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.btn-add-cart:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.product-owned {
    color: #4CAF50;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Cart Modal */
.cart-modal-content {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-primary);
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-type {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
    margin-right: 12px;
}

.btn-remove-item {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-item:hover {
    background: #cc0000;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    color: var(--text-primary);
}

.cart-bonus-errors {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 68, 68, 0.1);
    border-left: 3px solid var(--error);
    border-radius: 4px;
}

.cart-error-message {
    color: var(--error);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 6px;
}

.cart-error-message:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-footer .btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary {
    background: #555;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #666;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.cart-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .market-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .app-header {
        padding: 0 40px;
    }

    .main-content {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .market-products {
        grid-template-columns: repeat(3, 1fr);
    }

    .player-layout {
        grid-template-columns: 300px 1fr;
    }
}

/* ============================================
   PLAYER SECTION (v2.0)
   ============================================ */

.player-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.player-card {
    background: rgba(25, 55, 85, 0.6);
    border: 1px solid rgba(10, 25, 41, 0.8);
    border-radius: 12px;
    padding: 12px;
}

.card-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Categories List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.category-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.category-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    stroke: currentColor;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.category-item.active .category-icon {
    opacity: 1;
}

.category-item:hover .category-icon {
    opacity: 1;
}

.category-name {
    flex: 1;
}

.category-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Content List */
.content-list {
    max-height: 400px;
    overflow-y: auto;
}

.content-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.content-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.content-item.playing {
    background: var(--primary);
    border-color: var(--primary);
}

.content-item.playing .content-item-name,
.content-item.playing .content-item-meta {
    color: white;
}

.content-item-info {
    flex: 1;
}

.content-item-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.content-item-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.content-item-duration {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Audio Player v2 */
.audio-player-v2 {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 18px;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-info {
    text-align: center;
    margin-bottom: 16px;
}

.now-playing-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.now-playing-type {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Duration Control */
.duration-control {
    margin-bottom: 20px;
}

.duration-control label {
    display: block;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.duration-control strong {
    color: var(--primary);
}

.duration-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.duration-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.duration-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.duration-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Duration control disabled state (when loop is active) */
.duration-control input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.duration-control input[type="range"]:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.3);
}

.duration-control input[type="range"]:disabled::-moz-range-thumb {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.3);
}

/* Loop Control */
.loop-control {
    margin-bottom: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.05rem;
}

.elite-badge {
    background: linear-gradient(135deg, #9C27B0, #E91E63);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.premium-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Inversion Control */
.inversion-control {
    margin-bottom: 20px;
}

.info-icon {
    font-size: 1rem;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.info-icon:hover {
    opacity: 1;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-control {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.btn-control:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

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

.btn-control svg {
    width: 24px;
    height: 24px;
}

.btn-play-v2,
.btn-pause-v2 {
    width: 72px;
    height: 72px;
}

.btn-play-v2 svg,
.btn-pause-v2 svg {
    width: 32px;
    height: 32px;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.time-current,
.time-total {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    min-width: 45px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-icon {
    width: 24px;
    height: 24px;
    stroke: var(--text-secondary);
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-value {
    color: var(--text-secondary);
    font-size: 1rem;
    min-width: 45px;
}

/* Equalizer Control (Premium/Elite) */
.equalizer-control {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.eq-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.eq-icon {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    opacity: 0.8;
}

.eq-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.premium-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eq-sliders {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.eq-slider-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.eq-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.eq-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.eq-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.eq-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

.eq-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.eq-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.eq-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.eq-preset-btn {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eq-preset-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    color: var(--text-primary);
}

.eq-preset-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

@media (min-width: 768px) {
    .player-layout {
        grid-template-columns: 280px 1fr;
    }
}

/* ==================== Upgrade Link ==================== */
.upgrade-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.upgrade-link:hover {
    color: var(--secondary);
}

/* Product duration display */
.product-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 8px 0;
    font-weight: 500;
}

/* Disabled button state */
.btn-add-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.btn-add-cart:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== Daily Listens Counter ==================== */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.stat-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

.progress-bar-listen {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill-listen {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}
