/**
 * Feed Instagram - Estilos
 * Autor: Dumont Web (https://dumontweb.com.br)
 * Versão: 1.0.0
 */

/* ========================================
   RESET E BASE
   ======================================== */
.autosul-feed-container {
    max-width: 470px;
    margin: 0 auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
}

.autosul-feed-container * {
    box-sizing: border-box;
}

/* ========================================
   HEADER DO FEED
   ======================================== */
.autosul-feed-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 20px;
    margin: 0 -15px 20px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.autosul-feed-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: -0.5px;
}

.autosul-feed-header p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

/* ========================================
   CARDS DO FEED
   ======================================== */
.autosul-feed-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

.autosul-feed-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #dbdbdb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.autosul-feed-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   HEADER DO CARD (LOJA)
   ======================================== */
.autosul-card-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
}

.autosul-store-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.autosul-store-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.autosul-store-info {
    flex: 1;
    min-width: 0;
}

.autosul-store-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autosul-store-location {
    font-size: 0.75rem;
    color: #8e8e8e;
    display: flex;
    align-items: center;
    gap: 3px;
}

.autosul-store-location svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   IMAGEM DO CARRO
   ======================================== */
.autosul-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #f0f0f0;
    overflow: hidden;
}

.autosul-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.autosul-card-image:hover img {
    transform: scale(1.02);
}

.autosul-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
}

.autosul-card-image-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

/* Badge de preço sobre a imagem */
.autosul-price-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Badge de ano */
.autosul-year-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
}

/* ========================================
   AÇÕES (LIKE, SHARE, WHATSAPP)
   ======================================== */
.autosul-card-actions {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 16px;
}

.autosul-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    border-radius: 50%;
}

.autosul-action-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

.autosul-action-btn:active {
    transform: scale(0.95);
}

.autosul-action-btn svg {
    width: 26px;
    height: 26px;
    transition: all 0.2s ease;
}

/* Like button */
.autosul-like-btn svg {
    color: #262626;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.autosul-like-btn.liked svg {
    color: #ed4956;
    fill: #ed4956;
    stroke: #ed4956;
}

.autosul-like-btn.animating svg {
    animation: likeAnimation 0.4s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Copy link button */
.autosul-copy-btn svg {
    color: #262626;
}

.autosul-copy-btn.copied svg {
    color: #10b981;
}

/* WhatsApp button */
.autosul-whatsapp-btn {
    margin-left: auto;
    background: #25d366;
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.autosul-whatsapp-btn:hover {
    background: #128c7e;
    transform: scale(1.02);
}

.autosul-whatsapp-btn svg {
    width: 18px;
    height: 18px;
}

/* Share button */
.autosul-share-btn svg {
    color: #262626;
}

/* ========================================
   LIKES COUNT
   ======================================== */
.autosul-likes-count {
    padding: 0 14px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
}

/* ========================================
   INFO DO CARRO
   ======================================== */
.autosul-card-info {
    padding: 8px 14px 14px;
}

.autosul-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: #262626;
    margin: 0 0 8px;
    line-height: 1.3;
}

.autosul-card-title a {
    color: inherit;
    text-decoration: none;
}

.autosul-card-title a:hover {
    text-decoration: underline;
}

.autosul-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.autosul-spec-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 20px;
}

.autosul-spec-item svg {
    width: 14px;
    height: 14px;
    color: #888;
}

/* ========================================
   VER DETALHES
   ======================================== */
.autosul-card-footer {
    padding: 0 14px 14px;
}

.autosul-ver-detalhes {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.autosul-ver-detalhes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   LOADING E ESTADOS
   ======================================== */
.autosul-feed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.autosul-feed-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.autosul-feed-loading-text {
    font-size: 0.9rem;
    color: #8e8e8e;
}

/* Empty state */
.autosul-feed-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e8e;
}

.autosul-feed-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.autosul-feed-empty h3 {
    margin: 0 0 8px;
    color: #262626;
    font-size: 1.1rem;
}

.autosul-feed-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Error state */
.autosul-feed-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff8f8;
    border-radius: 12px;
    margin: 20px 0;
}

.autosul-feed-error p {
    color: #d32f2f;
    margin: 0 0 16px;
}

.autosul-retry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.autosul-retry-btn:hover {
    transform: scale(1.05);
}

/* End of feed */
.autosul-feed-end {
    text-align: center;
    padding: 30px 20px;
    color: #8e8e8e;
    font-size: 0.9rem;
}

.autosul-feed-end svg {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.autosul-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #262626;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.autosul-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.autosul-toast.success {
    background: #10b981;
}

.autosul-toast.error {
    background: #ef4444;
}

/* ========================================
   DOUBLE TAP HEART ANIMATION
   ======================================== */
.autosul-heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 10;
}

.autosul-heart-animation svg {
    width: 100px;
    height: 100px;
    fill: #fff;
    filter: drop-shadow(0 0 20px rgba(237, 73, 86, 0.8));
}

.autosul-heart-animation.animate svg {
    animation: heartBurst 0.8s ease forwards;
}

@keyframes heartBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ========================================
   RESPONSIVO
   ======================================== */
@media (min-width: 768px) {
    .autosul-feed-container {
        padding: 20px;
    }
    
    .autosul-feed-header {
        margin: 0 -20px 24px;
        padding: 20px;
        border-radius: 0 0 16px 16px;
    }
    
    .autosul-feed-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .autosul-feed-container {
        padding: 0 10px;
    }
    
    .autosul-feed-header {
        margin: 0 -10px 16px;
        padding: 14px 16px;
    }
    
    .autosul-feed-header h1 {
        font-size: 1.3rem;
    }
    
    .autosul-card-image {
        aspect-ratio: 1 / 1;
    }
    
    .autosul-price-badge {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .autosul-action-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .autosul-whatsapp-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .autosul-whatsapp-btn span {
        display: none;
    }
}

/* ========================================
   SKELETON LOADING
   ======================================== */
.autosul-skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dbdbdb;
}

.autosul-skeleton-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
}

.autosul-skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.autosul-skeleton-text {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.autosul-skeleton-text.w-50 { width: 50%; }
.autosul-skeleton-text.w-30 { width: 30%; }

.autosul-skeleton-image {
    aspect-ratio: 4 / 5;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.autosul-skeleton-actions {
    display: flex;
    gap: 16px;
    padding: 14px;
}

.autosul-skeleton-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.autosul-skeleton-info {
    padding: 8px 14px 14px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */
.autosul-action-btn:focus,
.autosul-ver-detalhes:focus,
.autosul-whatsapp-btn:focus,
.autosul-retry-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .autosul-feed-spinner,
    .autosul-skeleton-avatar,
    .autosul-skeleton-text,
    .autosul-skeleton-image,
    .autosul-skeleton-btn,
    .autosul-like-btn.animating svg,
    .autosul-heart-animation.animate svg {
        animation: none;
    }
    
    .autosul-toast,
    .autosul-feed-card,
    .autosul-action-btn,
    .autosul-ver-detalhes,
    .autosul-whatsapp-btn {
        transition: none;
    }
}
