/* tracks.css */
/* Track components, feed layout, and audio players */

/* ===== TRACK STYLES ===== */

.track-artwork {
    object-fit: cover;
    border-radius: var(--border-radius-md);
    flex-shrink: 0;
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.track-artwork:hover {
    transform: scale(1.02);
}

.track-artwork-placeholder {
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.track-artwork-placeholder:hover {
    transform: scale(1.02);
}

/* ===== TRACK CARD LAYOUT ===== */

/* Default styles */
.track-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    background: linear-gradient(135deg, #fefefe 0%, #f9f9f9 100%);
    border-radius: 12px;
    padding: 20px;
    margin: -4px;
    /* Compensate for card-body padding */
}

.track-artwork,
.track-artwork-placeholder {
    width: 240px;
    height: 240px;
    aspect-ratio: 1 / 1;
}

.track-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: right;
    width: 100%;
}

/* ===== TRACK CONTENT COMPONENTS ===== */

.track-profile-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.track-profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.track-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.track-profile-name {
    font-weight: 600;
    font-size: 0.9em;
    color: #666;
}

.track-profile-timestamp {
    font-size: 0.8em;
    color: #999;
    white-space: nowrap;
}

.track-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
    text-align: left;
    width: 100%;
    text-transform: none;
}

.track-title a {
    color: #333;
    transition: color 0.2s ease;
    font-weight: 600;
}

.track-title a:hover {
    color: #007bff;
}

.track-description {
    font-size: 0.95em;
    color: #666;
    line-height: 1.4;
    margin-bottom: 16px;
    min-height: 1.4em;
    flex-shrink: 0;
    text-align: left;
    width: 100%;
}

.track-description:empty::before {
    /* Non-breaking space to ensure height if no description */
    content: "\00a0";
    visibility: hidden;
}

.track-audio-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
}

.track-audio-section audio {
    width: 100%;
    height: 45px;
    border-radius: 8px;
    background: #f8f9fa;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.track-audio-section a {
    font-size: 0.95em;
    color: #666;
    transition: color 0.2s ease;
    text-decoration: none !important;
    align-self: flex-end;
}

.track-audio-section a:hover {
    color: #007bff;
}

/* ===== Card Styles ===== */

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ===== FEED LAYOUT ===== */

body .feed-page,
.container .feed-page {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
}

.feed-page #track-feed {
    max-width: 95%;
    margin: 0 auto;
}

/* ===== TRACK DETAIL PAGE  ===== */
.track-detail-artwork {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    display: block;
    margin: 0 auto 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.track-detail-artwork-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 24px;
    margin: 0 auto 1rem;
    /* Center on mobile */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------- */
/* ================= MEDIA QUERIES =================== */
/* --------------------------------------------------- */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .track-card-body {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }

    .track-artwork,
    .track-artwork-placeholder {
        width: 100px;
        height: 100px;
    }

    .track-content {
        text-align: right;
    }

    .track-audio-section audio {
        background: #f1f3f4;
        border: 1px solid #e0e0e0;
        height: 50px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {

    .track-artwork,
    .track-artwork-placeholder {
        width: 180px;
        height: 180px;
    }

    /* detail page */
    .track-detail-artwork,
    .track-detail-artwork-placeholder {
        width: 190px;
        height: 190px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {

    .track-artwork,
    .track-artwork-placeholder {
        width: 180px;
        height: 180px;
    }

    /* detail page artwork */
    .track-detail-artwork,
    .track-detail-artwork-placeholder {
        width: 250px;
        height: 250px;
    }

    .track-card-body {
        gap: 24px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {

    .track-artwork,
    .track-artwork-placeholder {
        width: 150px;
        height: 150px;
    }

    .feed-page #track-feed {
        max-width: 90%;
    }
}

/* XXL devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {

    .track-artwork,
    .track-artwork-placeholder {
        width: 200px;
        height: 200px;
    }

    .feed-page #track-feed {
        max-width: 85%;
    }

    .track-detail-artwork,
    .track-detail-artwork-placeholder {
        height: 300px;
        width: 300px;
    }
}