/* FAFQ TV - Animações e Melhorias de Responsividade */

/* ===================================
   ANIMAÇÕES PARA TÍTULOS LONGOS
   =================================== */

/* Container para títulos com animação de marquee */
.program-details h4 {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}

/* Animação de marquee para títulos longos */
.program-details h4.long-title {
    animation: marquee 15s linear infinite;
    animation-delay: 2s;
}

.program-details h4.long-title:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    10% {
        transform: translateX(0%);
    }
    90% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Alternativa: Animação de fade-in/fade-out para títulos muito longos */
.program-details h4.fade-title {
    animation: fadeInOut 8s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 20% {
        opacity: 1;
        transform: translateX(0);
    }
    25%, 75% {
        opacity: 0.7;
        transform: translateX(-20px);
    }
    80%, 100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Efeito de expansão ao hover para melhor legibilidade */
.program-item:hover .program-details h4 {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    max-height: none;
    transition: all 0.3s ease;
}

/* ===================================
   MELHORIAS DE RESPONSIVIDADE MOBILE
   =================================== */

/* Ajustes gerais para dispositivos móveis */
@media (max-width: 768px) {
    
    /* Header responsivo */
    .header {
        padding: 10px 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-subtitle {
        font-size: 10px;
    }
    
    .header-clock {
        text-align: center;
    }
    
    .header-clock-time {
        font-size: 16px;
    }
    
    .header-clock-date {
        font-size: 11px;
    }
    
    /* Layout principal responsivo */
    .main-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .left-column,
    .right-column {
        width: 100%;
    }
    
    /* Cards responsivos */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-title {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    /* Twitch embed responsivo */
    .twitch-container {
        height: 200px;
    }
    
    .twitch-container iframe {
        height: 200px;
    }
    
    /* Programa atual responsivo */
    .program-title {
        font-size: 16px;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .program-time {
        font-size: 12px;
        gap: 15px;
    }
    
    .time-remaining {
        font-size: 12px;
    }
    
    /* Próximo programa responsivo */
    .next-program-title {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .next-program-time {
        font-size: 11px;
    }
    
    /* Busca responsiva */
    .search-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .search-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Lista de programas responsiva */
    .program-item {
        padding: 12px;
        gap: 10px;
    }
    
    .program-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .program-details h4 {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .program-details .time {
        font-size: 11px;
    }
    
    .program-duration {
        font-size: 11px;
        min-width: 40px;
    }
    
    /* Estados vazios responsivos */
    .empty-state {
        padding: 20px;
    }
    
    .empty-state i {
        font-size: 24px;
    }
    
    .empty-state h3 {
        font-size: 14px;
    }
    
    .empty-state p {
        font-size: 12px;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    
    .main-container {
        padding: 10px;
        gap: 10px;
    }
    
    .card {
        margin-bottom: 10px;
    }
    
    .card-title {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .twitch-container {
        height: 180px;
    }
    
    .twitch-container iframe {
        height: 180px;
    }
    
    .program-title {
        font-size: 15px;
    }
    
    .program-item {
        padding: 10px;
        gap: 8px;
    }
    
    .program-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .program-details h4 {
        font-size: 12px;
    }
    
    .program-details .time {
        font-size: 10px;
    }
    
    .program-duration {
        font-size: 10px;
        min-width: 35px;
    }
}

/* ===================================
   ANIMAÇÕES SUAVES E TRANSIÇÕES
   =================================== */

/* Transições suaves para todos os elementos interativos */
.program-item,
.search-input,
.search-btn,
.card {
    transition: all 0.3s ease;
}

/* Efeito hover melhorado para itens de programa */
.program-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.15);
}

/* Animação de entrada para cards */
.card {
    animation: slideInUp 0.6s ease-out;
}

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

/* Animação para itens de programa */
.program-item {
    animation: fadeInLeft 0.5s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   MELHORIAS ESPECÍFICAS PARA TÍTULOS
   =================================== */

/* Tooltip para títulos longos */
.program-details h4[title] {
    cursor: help;
}

/* Indicador visual para títulos que possuem animação */
.program-details h4.long-title::after {
    content: "→";
    position: absolute;
    right: 0;
    top: 0;
    background: linear-gradient(to right, transparent, var(--card-bg) 50%);
    padding-left: 10px;
    opacity: 0.7;
    font-size: 12px;
}

/* Esconder indicador quando em hover */
.program-item:hover .program-details h4.long-title::after {
    display: none;
}

/* ===================================
   OTIMIZAÇÕES DE PERFORMANCE
   =================================== */

/* Usar transform3d para ativação de aceleração de hardware */
.program-details h4.long-title {
    transform: translate3d(0, 0, 0);
}

/* Reduzir motion para usuários que preferem menos animação */
@media (prefers-reduced-motion: reduce) {
    .program-details h4.long-title,
    .program-details h4.fade-title {
        animation: none;
    }
    
    .program-item:hover {
        transform: none;
    }
    
    .card {
        animation: none;
    }
    
    .program-item {
        animation: none;
    }
}

/* ===================================
   MELHORIAS DE ACESSIBILIDADE
   =================================== */

/* Melhor contraste para textos pequenos */
@media (max-width: 768px) {
    .program-details .time,
    .program-duration {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* Foco visível para navegação por teclado */
.program-item:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Área de toque maior para dispositivos móveis */
@media (max-width: 768px) {
    .program-item {
        min-height: 60px;
        cursor: pointer;
    }
    
    .search-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

