﻿/* ========================================
   ENHANCED ARTIST CARDS STYLES
   ======================================== */

.enhanced-artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    /* Força estabilidade do grid */
    min-height: 200px;
}

    /* Estados de carregamento para mobile */
    .enhanced-artists-grid.images-loading {
        opacity: 0.7;
    }

    .enhanced-artists-grid.layout-ready {
        opacity: 1;
        transition: opacity 0.3s ease;
    }

.enhanced-artist-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Força altura mínima para estabilizar layout */
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

    /* Estado durante carregamento da imagem */
    .enhanced-artist-card:not(.image-loaded) .artist-image-wrapper {
        background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0), linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
        background-size: 20px 20px;
        background-position: 0 0, 10px 10px;
        animation: loading-shimmer 1.5s infinite linear;
    }

/* Animação de carregamento */
@keyframes loading-shimmer {
    0% {
        background-position: 0 0, 10px 10px;
    }

    100% {
        background-position: 20px 20px, 30px 30px;
    }
}

/* Quando a imagem carrega */
.enhanced-artist-card.image-loaded .artist-image-wrapper img {
    opacity: 1 !important;
}

.enhanced-artist-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #4B2E7F);
}

/* ========================================
   CARD IMAGE SECTION
   ======================================== */

.card-image-container {
    position: relative;
    height: 240px;
    overflow: hidden;
    /* Força altura fixa para evitar layout shift */
    flex-shrink: 0;
}

.artist-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
}

    .artist-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease, opacity 0.3s ease;
        /* Começa invisível até carregar */
        opacity: 0;
    }

.enhanced-artist-card:hover .artist-image-wrapper img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(75, 46, 127, 0.9) 0%, rgba(106, 75, 138, 0.8) 100%);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.enhanced-artist-card:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.enhanced-artist-card:hover .overlay-content {
    transform: translateY(0);
}

.view-profile-btn {
    background: white;
    color: var(--primary-color, #4B2E7F);
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .view-profile-btn:hover {
        background: var(--primary-color, #4B2E7F);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    }

.sound-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
    z-index: 2;
}

.music-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #4B2E7F);
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* ========================================
   CARD CONTENT SECTION
   ======================================== */

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.artist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.artist-name {
    margin: 0;
    flex: 1;
}

    .artist-name a {
        color: var(--text-dark, #2C3E50);
        text-decoration: none;
        font-size: 1.3rem;
        font-weight: 700;
        line-height: 1.3;
        transition: color 0.3s ease;
        display: block;
    }

        .artist-name a:hover {
            color: var(--primary-color, #4B2E7F);
        }

.price-tag {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

.artist-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light, #7F8C8D);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

    .artist-location i {
        color: var(--primary-color, #4B2E7F);
        width: 16px;
        flex-shrink: 0;
    }

.artist-description {
    color: var(--text-dark, #2C3E50);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 0.95rem;
    flex: 1;
}

/* ========================================
   CATEGORIES AND DETAILS
   ======================================== */

.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: auto;
}

.category-tag {
    background: linear-gradient(135deg, var(--primary-color, #4B2E7F) 0%, #6A4B8A 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

    .category-tag:hover {
        transform: translateY(-1px);
    }

.artist-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light, #7F8C8D);
    font-size: 0.9rem;
    flex: 1;
}

    .detail-item i {
        width: 16px;
        color: var(--primary-color, #4B2E7F);
    }

.sound-status.sound-yes {
    color: #2ECC71;
}

    .sound-status.sound-yes i {
        color: #2ECC71;
    }

.sound-status.sound-no {
    color: #E74C3C;
}

    .sound-status.sound-no i {
        color: #E74C3C;
    }

/* ========================================
   CARD ACTIONS
   ======================================== */

.card-actions {
    display: flex;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #4B2E7F) 0%, #6A4B8A 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(75, 46, 127, 0.2);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(75, 46, 127, 0.3);
        color: white;
        text-decoration: none;
    }

.btn-secondary {
    background: transparent;
    color: var(--primary-color, #4B2E7F);
    border: 2px solid var(--primary-color, #4B2E7F);
}

    .btn-secondary:hover {
        background: var(--primary-color, #4B2E7F);
        color: white;
        transform: translateY(-2px);
    }

/* ========================================
   LOADING AND ERROR STATES
   ======================================== */

.loading-artists,
.empty-state,
.error-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.empty-icon,
.error-icon {
    margin-bottom: 2rem;
}

.empty-state h4,
.error-state h4 {
    color: var(--text-dark, #2C3E50);
    margin-bottom: 1rem;
}

.empty-state p,
.error-state p {
    color: var(--text-light, #7F8C8D);
    text-align: center;
    line-height: 1.6;
    max-width: 400px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color, #4B2E7F);
    border: 2px solid var(--primary-color, #4B2E7F);
}

    .btn-outline-primary:hover {
        background: var(--primary-color, #4B2E7F);
        color: white;
        text-decoration: none;
    }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #4B2E7F) 0%, #6A4B8A 100%);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(75, 46, 127, 0.3);
    }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .enhanced-artists-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .enhanced-artist-card {
        border-radius: 12px;
        min-height: 350px;
    }

    .card-image-container {
        height: 180px;
    }

    .card-content {
        padding: 20px;
    }

    .artist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .artist-name a {
        font-size: 1.2rem !important;
    }

    .price-tag {
        align-self: flex-start;
    }

    .artist-details {
        flex-direction: column;
        gap: 12px;
    }

    .card-actions {
        flex-direction: column;
    }

    .categories-container {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .enhanced-artists-grid {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        gap: 1rem;
    }

    .enhanced-artist-card {
        min-height: 320px;
    }

    .card-image-container {
        height: 160px;
    }

    .card-content {
        padding: 16px;
    }

    .artist-name a {
        font-size: 1.1rem;
    }

    .loading-artists,
    .empty-state,
    .error-state {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

    /* Otimizações críticas para iOS/iPhone */
    .enhanced-artist-card {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* Força aceleração de hardware */
        will-change: transform;
    }

        .enhanced-artist-card:hover {
            -webkit-transform: translateY(-4px) translateZ(0);
            transform: translateY(-4px) translateZ(0);
        }

    .artist-image-wrapper {
        /* Força compositing layer */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

        .artist-image-wrapper img {
            /* Força aceleração de hardware para imagens */
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
}
