/* ========================================
   MOBILE HOME PAGE - DESIGN EXCLUSIVO
   ======================================== */

/* Reset para mobile home */
.mobile-home-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Variáveis para alinhamento do header/nav/feed */
:root {
    --mobile-header-height: 56px; /* Altura padrão do header mobile */
    --mobile-nav-top-offset: 28px; /* Espaço entre header e nav fixa */
    --mobile-feed-extra-offset: 80px; /* Espaço somado ao header para o feed */
}

/* ========================================
   HEADER MOBILE
   ======================================== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Garantir que o header da home mobile seja fixo */
.mobile-home-page .header-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    transform: translateY(0) !important; /* Força o header a ficar sempre visível */
    transition: none !important; /* Remove a transição que pode causar problemas */
}

.mobile-logo {
    height: 32px;
    width: auto;
}

.mobile-search-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.mobile-search-btn:active {
    background-color: #f0f0f0;
}

/* ========================================
    NAVEGAÇÃO HORIZONTAL FIXA
    ======================================== */
.mobile-home-page .mobile-nav-fixed {
    position: fixed !important;
    top: calc(var(--mobile-header-height) + var(--mobile-nav-top-offset)) !important; /* Abaixo do header */
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    z-index: 999 !important;
    padding: 12px 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.mobile-nav-fixed::-webkit-scrollbar {
    display: none;
}

.mobile-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 16px;
    gap: 24px;
    white-space: nowrap;
}

.mobile-nav-item {
    flex-shrink: 0;
}

.mobile-nav-link {
    display: block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

/* ========================================
    HERO SECTION (OCULTO)
    ======================================== */
.mobile-hero {
    display: none !important;
}

.mobile-hero-image {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.mobile-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.mobile-hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
}

/* ========================================
    FEED INFINITO
    ======================================== */
.mobile-home-page .mobile-feed {
    margin-top: calc(var(--mobile-header-height) + var(--mobile-feed-extra-offset)) !important; /* Header + Nav */
    padding: 16px !important;
    padding-bottom: 80px !important; /* Espaço para FAB */
}

.mobile-feed-item {
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-feed-item:active {
    transform: scale(0.98);
}

/* ========================================
   CARD DE VÍDEO
   ======================================== */
.mobile-home-page .mobile-video-card {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-width: auto !important;
    flex: none !important;
}

.mobile-video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.mobile-home-page .mobile-video-thumbnail {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    background: #f0f0f0 !important;
    display: block !important;
}

.mobile-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
}



.mobile-video-info {
    padding: 16px;
}

.mobile-video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #1a1a1a;
}

.mobile-video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.mobile-video-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-video-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
    CARD DE PRODUTO
    ======================================== */
.mobile-home-page .mobile-product-card {
    position: relative !important;
    padding: 16px !important;
    border-left: 4px solid #28a745 !important;
}

.mobile-home-page .mobile-product-channel-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    background: #28a745 !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    z-index: 2 !important;
}

.mobile-product-content {
    display: flex;
    gap: 16px;
}

.mobile-product-image-container {
    position: relative;
    flex-shrink: 0;
}

.mobile-home-page .mobile-product-image {
    width: 120px !important; /* Aumentado em 50% */
    height: 120px !important; /* Aumentado em 50% */
    object-fit: cover !important;
    border-radius: 8px !important;
    background: #f0f0f0 !important;
}

.mobile-product-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobile-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.mobile-product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 5px !important;
    line-height: 1.4;
    color: #1a1a1a;
}

.mobile-product-price {
    display: none !important;
}

.mobile-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-top: 4px;
    margin-bottom: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}





/* ========================================
    CARD DE ARTIGO
    ======================================== */
.mobile-home-page .mobile-article-card {
    position: relative !important;
    padding: 16px !important;
    border-left: 4px solid #007bff !important;
}

.mobile-home-page .mobile-article-channel-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    background: #007bff !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    z-index: 2 !important;
}

.mobile-article-content {
    display: flex;
    gap: 16px;
}

.mobile-article-image-container {
    position: relative;
    flex-shrink: 0;
}

.mobile-home-page .mobile-article-image {
    width: 120px !important; /* Aumentado em 50% */
    height: 120px !important; /* Aumentado em 50% */
    object-fit: cover !important;
    border-radius: 8px !important;
    background: #f0f0f0 !important;
}

.mobile-article-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobile-article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-article-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 5px !important;
    line-height: 1.4;
    color: #1a1a1a;
}

.mobile-article-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    flex: 1;
}

.mobile-article-meta {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.mobile-article-date {
    color: #666;
}

.mobile-article-views {
    color: #666;
}

/* ========================================
    CARD DE EBOOK
    ======================================== */
.mobile-home-page .mobile-ebook-card {
    position: relative !important;
    padding: 16px !important;
    border-left: 4px solid #6f42c1 !important;
}

.mobile-home-page .mobile-ebook-channel-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    background: #6f42c1 !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    z-index: 2 !important;
}

.mobile-ebook-content {
    display: flex;
    gap: 16px;
}

.mobile-ebook-image-container {
    position: relative;
    flex-shrink: 0;
}

.mobile-home-page .mobile-ebook-image {
    width: 120px !important; /* Aumentado em 50% */
    height: 120px !important; /* Aumentado em 50% */
    object-fit: cover !important;
    border-radius: 8px !important;
    background: #f0f0f0 !important;
}

.mobile-ebook-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #6f42c1;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobile-ebook-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-ebook-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 5px !important;
    line-height: 1.4;
    color: #1a1a1a;
}

.mobile-ebook-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    margin-top: auto;
}



.mobile-ebook-downloads {
    color: #666;
}

/* ========================================
   BOTÃO FLUTUANTE (FAB)
   ======================================== */
.mobile-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(0,123,255,0.3);
    z-index: 1000;
    transition: all 0.2s;
    cursor: pointer;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* ========================================
   MENU LATERAL (DRAWER)
   ======================================== */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* Não intercepta cliques quando fechado */
}

.mobile-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all; /* Intercepta cliques quando aberto */
}

.mobile-drawer-header {
    padding: 20px 16px;
    background: #007bff;
    color: #ffffff;
}

.mobile-drawer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.mobile-drawer-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.mobile-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
}

.mobile-drawer-content {
    padding: 16px 0;
}

.mobile-drawer-section {
    margin-bottom: 24px;
}

.mobile-drawer-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 16px;
}

.mobile-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-drawer-item {
    margin: 0;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.mobile-drawer-link:hover,
.mobile-drawer-link.active {
    background: #f8f9fa;
    border-left-color: #007bff;
}

.mobile-drawer-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* ========================================
   CORREÇÃO PARA MENU ANTIGO
   ======================================== */
/* Ocultar menu antigo (.main-nav) no mobile para evitar conflito com mobile drawer */
@media (max-width: 768px) {
    .main-nav {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ========================================
   MENU DO USUÁRIO NO DRAWER
   ======================================== */
.mobile-user-info {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 8px 0;
    border-left: 3px solid #007bff;
}

.mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #e0e0e0;
}

.mobile-user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mobile-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.mobile-user-email {
    font-size: 12px;
    color: #666;
    opacity: 0.8;
}

.mobile-logout-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    color: #dc3545;
    font-weight: 500;
}

.mobile-logout-btn:hover {
    background: #f8f9fa;
    color: #c82333;
}

/* ========================================
   LOADING E ESTADOS
   ======================================== */
.mobile-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.mobile-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

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

.mobile-empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #666;
}

.mobile-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.mobile-empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mobile-empty-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

/* ========================================
    RESPONSIVIDADE E AJUSTES
    ======================================== */
@media (max-width: 480px) {
    .mobile-nav-list {
        gap: 16px;
        padding: 0 12px;
    }
    
    .mobile-nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .mobile-hero {
        padding: 20px 12px;
    }
    
    .mobile-hero-title {
        font-size: 20px;
    }
    
    .mobile-feed {
        padding: 12px;
    }
    
    .mobile-fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    
    /* Ajustes para imagens em telas muito pequenas */
    .mobile-product-image,
    .mobile-article-image,
    .mobile-ebook-image {
        width: 60px;
        height: 60px;
    }
    
    .mobile-video-thumbnail {
        aspect-ratio: 16/9;
        min-height: 120px;
    }
}

/* Ajustes para tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .mobile-video-thumbnail {
        aspect-ratio: 16/9;
        min-height: 180px;
    }
    
    .mobile-product-image,
    .mobile-article-image,
    .mobile-ebook-image {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   ANIMAÇÕES E TRANSITIONS
   ======================================== */
.mobile-feed-item {
    animation: fadeInUp 0.5s ease-out;
}

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

/* ========================================
    UTILITÁRIOS
    ======================================== */
.mobile-hidden {
    display: none !important;
}

.mobile-visible {
    display: block !important;
}

.mobile-text-center {
    text-align: center;
}

.mobile-text-muted {
    color: #666;
}

.mobile-mb-0 { margin-bottom: 0; }
.mobile-mb-1 { margin-bottom: 8px; }
.mobile-mb-2 { margin-bottom: 16px; }
.mobile-mb-3 { margin-bottom: 24px; }

.mobile-p-0 { padding: 0; }
.mobile-p-1 { padding: 8px; }
.mobile-p-2 { padding: 16px; }
.mobile-p-3 { padding: 24px; }

/* Utilitários para imagens responsivas */
.mobile-img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

.mobile-img-16-9 {
    aspect-ratio: 16/9;
    object-fit: cover;
}

.mobile-img-square {
    aspect-ratio: 1/1;
    object-fit: cover;
}

.mobile-img-cover {
    object-fit: cover;
}

.mobile-img-contain {
    object-fit: contain;
}
