/* CSS para o feed estilo TikTok */

/* Hero Section para visitantes */
.hero-section {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(6, 182, 212, 0.3) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--white);
}

.gradient-text {
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-video {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.floating-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: float 6s ease-in-out infinite;
}

.floating-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-weight: 600;
    animation: slideInRight 1s ease-out;
}

.floating-card:nth-child(2) {
    animation-delay: 0.2s;
    margin-left: 40px;
}

.floating-card:nth-child(3) {
    animation-delay: 0.4s;
    margin-left: 80px;
}

.floating-card i {
    font-size: 1.2rem;
    color: var(--secondary-blue);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Feed de vídeos */
.video-feed {
    min-height: 100vh;
    background: var(--black);
}

.feed-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Estado vazio do feed */
.empty-feed {
    text-align: center;
    padding: 100px 40px;
    color: var(--white);
}

.empty-feed i {
    font-size: 4rem;
    color: var(--gray);
    margin-bottom: 30px;
    display: block;
}

.empty-feed h3 {
    margin-bottom: 15px;
    color: var(--white);
}

.empty-feed p {
    color: var(--gray);
    margin-bottom: 30px;
}

/* Card de vídeo */
.video-card {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background: var(--black);
    scroll-snap-align: start;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Overlay de controles */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-pause-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--black);
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.play-pause-btn:hover {
    transform: scale(1.1);
    background: var(--white);
}

.play-pause-btn .fa-pause {
    display: none;
}

.video-player[data-playing="true"] + .video-overlay .play-pause-btn .fa-play {
    display: none;
}

.video-player[data-playing="true"] + .video-overlay .play-pause-btn .fa-pause {
    display: block;
}

/* Informações do vídeo */
.video-info {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 80px;
    color: var(--white);
    z-index: 10;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--white);
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.username {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified {
    color: var(--secondary-blue);
    font-size: 0.9rem;
}

.full-name {
    font-size: 0.9rem;
    color: var(--gray);
    margin: 0;
}

.follow-btn {
    padding: 8px 20px;
    background: transparent;
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.follow-btn:hover {
    background: transparent;
    transform: translateY(-2px);
}

.follow-btn.following {
    background: transparent;
}

.video-description {
    margin-bottom: 15px;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.description-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-bottom: 10px;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.hashtag {
    color: var(--light-blue);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.hashtag:hover {
    color: var(--white);
}

.video-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--gray);
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Ações laterais */
.video-actions {
    position: absolute;
    right: 20px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    transform: scale(1.1);
    background: transparent;
    color: var(--white);
}

.action-btn .count {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
    color: inherit;
}

/* Botão de like ativo */
.like-btn.liked {
    background: transparent;
    color: var(--white);
    animation: heartBeat 0.6s ease-in-out;
}

.like-btn.liked:hover {
    background: transparent;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Botão de som */
.sound-btn .fa-volume-up {
    display: none;
}

.sound-btn.unmuted .fa-volume-mute {
    display: none;
}

.sound-btn.unmuted .fa-volume-up {
    display: block;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--white);
    display: none;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.loading-indicator.active {
    display: block;
}

.loading-indicator .spinner {
    margin: 0 auto 20px;
}

/* Modal de comentários */
.comments-modal {
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    color: var(--dark-gray);
    margin: 0;
}

.close-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    color: var(--gray);
}

.close-btn:hover {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    max-height: 400px;
}

.comment-form {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.comment-form .form-input {
    flex: 1;
    background: var(--white);
    color: var(--dark-gray);
    border: 1px solid #e2e8f0;
}

.comment-form .btn {
    min-width: auto;
    padding: 10px 16px;
}

/* Scroll snap para mobile */
@media (max-width: 768px) {
    .feed-container {
        scroll-snap-type: y mandatory;
        overflow-y: auto;
        height: 100vh;
    }
    
    .video-card {
        scroll-snap-align: start;
        height: 100vh;
    }
    
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 60px 20px;
    }
    
    .hero-video {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 40px;
    }
    
    .floating-cards {
        flex-direction: row;
        justify-content: center;
    }
    
    .floating-card:nth-child(2),
    .floating-card:nth-child(3) {
        margin-left: 0;
    }
    
    .video-info {
        bottom: 60px;
        left: 16px;
        right: 70px;
    }
    
    .video-actions {
        right: 16px;
        bottom: 60px;
        gap: 15px;
    }
    
    .action-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .user-avatar {
        width: 45px;
        height: 45px;
    }
    
    .video-title {
        font-size: 1rem;
    }
    
    .description-text {
        font-size: 0.85rem;
    }
    
    .hashtag {
        font-size: 0.85rem;
    }
}

/* Animações de entrada */
.video-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.video-card:nth-child(even) {
    animation-delay: 0.1s;
}

.video-info > * {
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
}

.user-info {
    animation-delay: 0.2s;
}

.video-description {
    animation-delay: 0.4s;
}

.video-stats {
    animation-delay: 0.6s;
}

.video-actions .action-btn {
    opacity: 0;
    animation: slideInRight 0.6s ease-out forwards;
}

.video-actions .action-btn:nth-child(1) { animation-delay: 0.3s; }
.video-actions .action-btn:nth-child(2) { animation-delay: 0.4s; }
.video-actions .action-btn:nth-child(3) { animation-delay: 0.5s; }
.video-actions .action-btn:nth-child(4) { animation-delay: 0.6s; }

/* Estados de carregamento */
.video-loading {
    background: var(--gray);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Melhorias de performance */
.video-player {
    will-change: transform;
}

.action-btn {
    will-change: transform;
}

/* Dark mode específico para o feed */
@media (prefers-color-scheme: dark) {
    .comments-modal {
        background: var(--dark-gray);
        color: var(--white);
    }
    
    .modal-header {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .modal-header h3 {
        color: var(--white);
    }
    
    .comment-form {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .comment-form .form-input {
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* === AJAX FEED LOADING STATES === */

/* Loading spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.loading-spinner .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* End of feed message */
.end-of-feed {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
    color: #666;
}

.end-of-feed i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.end-of-feed h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.end-of-feed p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Error messages */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #ef4444;
    background-color: #fef2f2;
    border-radius: 8px;
    margin: 20px;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.error-message h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.error-message p {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.retry-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.retry-button:hover {
    background: #2563eb;
}

/* Initial loading state */
.initial-loading {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.initial-loading .loading-spinner {
    padding: 20px 0;
}

.initial-loading h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 600;
}

.initial-loading p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Empty feed state enhancement */
.empty-feed .btn {
    padding: 12px 24px;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.empty-feed .btn-primary {
    background: #3b82f6;
    color: white;
}

.empty-feed .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Mobile responsive adjustments for AJAX states */
@media (max-width: 768px) {
    .error-message {
        margin: 10px;
        padding: 30px 20px;
    }
    
    .loading-spinner {
        padding: 30px;
    }
    
    .end-of-feed {
        padding: 30px 20px;
    }
}