/**
 * Index View Styles
 * 
 * This file contains all the CSS styles specific to the index page.
 */

/* Stories Header */
.stories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 600;
}

.stories-header h5 {
    margin: 0;
}

.stories-header .btn {
    flex-shrink: 0;
}

/* Stories Wrapper */
.stories-wrapper {
    position: relative;
    padding-left: 20px;
    padding-right: 20px;
}

/* Group Stories */
.stories-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stories-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Navigation Buttons */
.stories-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.stories-nav:hover {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%) scale(1.05);
}

.stories-nav i {
    font-size: 1.3rem;
    color: #495057;
    font-weight: bold;
}

.stories-nav--prev {
    left: 2px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.stories-nav--next {
    right: 2px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Story Card */
.story-card {
    position: relative;
    width: 140px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0.5rem 0;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.story-card__media {
    position: relative;
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
}

.story-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.5) 40%,
            rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.story-card:hover .story-card__overlay {
    opacity: 0.95;
}

.story-card__avatar-container {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.story-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-card:hover .story-card__avatar {
    transform: scale(1.1);
}

.story-card__content {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    padding: 0 12px;
    text-align: center;
    color: white;
    z-index: 2;
}

.story-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    color: white;
}

.story-card__meta {
    font-size: 0.7rem;
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

/* Story Card with New Posts - Active State */
.story-card--active {
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #ff6b6b, #ee5a6f, #f06595, #cc5de8, #845ef7, #5c7cfa, #339af0, #22b8cf, #20c997, #51cf66, #94d82d, #fcc419, #ff922b, #ff6b6b) border-box;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% {
        filter: hue-rotate(0deg) brightness(1.1);
    }

    50% {
        filter: hue-rotate(180deg) brightness(1.2);
    }

    100% {
        filter: hue-rotate(360deg) brightness(1.1);
    }
}

.story-card--active:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.3);
}

/* Badge for New Posts Count */
.story-card__badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
    animation: pulse 2s ease-in-out infinite;
}

.story-card__badge .badge {
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    border: 2px solid white;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Post Card Animation */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.post-card.animated {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Media Queries */
@media (max-width: 768px) {

    /* Manter layout horizontal - título à esquerda, botão à direita */
    .stories-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .stories-header h5 {
        margin-bottom: 0 !important;
        font-size: 1.1rem;
    }

    /* Botão Ver Todos - apenas ícone */
    .stories-header .btn span {
        display: none;
    }

    .stories-header .btn {
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .stories-header .btn i {
        display: inline-block !important;
        margin: 0 !important;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .stories-wrapper {
        padding: 15px;
    }

    .stories-container {
        padding: 0.75rem;
    }

    .story-card {
        width: 120px;
        height: 180px;
    }

    .story-card__avatar {
        width: 40px;
        height: 40px;
    }

    .stories-nav {
        width: 32px;
        height: 70px;
    }

    .stories-nav--prev {
        left: 2px;
    }

    .stories-nav--next {
        right: 2px;
    }

    .stories-nav i {
        font-size: 1.1rem;
    }
}

@media (min-width: 992px) {
    .story-card {
        width: 160px;
        height: 220px;
    }

    .story-card__avatar {
        width: 52px;
        height: 52px;
    }
}

/* Carrossel Lateral */
.group-carousel1 {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.group-carousel-item {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 1px;
}

.group-carousel-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.5) 40%,
            rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.group-carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.group-carousel-avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ===== PUBLICAÇÕES EM DESTAQUE ===== */
.trending-header {
    margin-bottom: 1rem;
}

.trending-header .d-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trending-header h5 {
    margin: 0;
}

.trending-header .btn-group {
    flex-shrink: 0;
}

.trending-filter {
    transition: all 0.2s ease;
}

.trending-filter.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Trending Wrapper */
.trending-wrapper {
    position: relative;
    padding-left: 20px;
    padding-right: 20px;

}

.trending-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 1.25rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.trending-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Navigation Buttons for Trending */
.trending-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 120px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.trending-nav:hover {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    transform: translateY(-50%) scale(1.05);
}

.trending-nav--prev {
    left: 2px;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.trending-nav--next {
    right: 2px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.trending-nav i {
    font-size: 1.4rem;
    color: #495057;
    font-weight: bold;
}

/* Trending Card */
.trending-card {
    position: relative;
    width: 320px;
    min-width: 320px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.trending-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.trending-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Banner de Imagem no Topo do Card */
.trending-card__image-banner {
    width: 100%;
    height: 70px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.trending-card__image-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

/* Badge de tipo dentro do banner */
.trending-card__image-banner .trending-card__type {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.trending-card__image-banner .trending-card__type i {
    font-size: 0.8rem;
}

.trending-card--with-image .trending-card__content {
    border-radius: 0 0 16px 16px;
}

.trending-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.trending-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
}

.trending-card__badge .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Badge de tipo quando NÃO há banner (fallback) */
.trending-card__type--no-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin: 0 1.5rem;
    margin-top: 1rem;
}

.trending-card__type--no-banner i {
    font-size: 0.9rem;
}

.trending-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.2rem;
}

.trending-card__subject {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
    padding: 0.4rem 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    width: fit-content;
}

.trending-card__subject i {
    color: #667eea;
}

.trending-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.trending-card__author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
}

.trending-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.trending-card__stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
}

.stat-item i {
    font-size: 0.9rem;
}

.trending-card__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #1db954;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    background: rgba(29, 185, 84, 0.1);
    border-radius: 8px;
    width: fit-content;
}

.trending-card__group i {
    font-size: 0.9rem;
}

/* Animação de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trending-card {
    animation: fadeInUp 0.5s ease-out;
}

.trending-card:nth-child(1) {
    animation-delay: 0.1s;
}

.trending-card:nth-child(2) {
    animation-delay: 0.2s;
}

.trending-card:nth-child(3) {
    animation-delay: 0.3s;
}

.trending-card:nth-child(4) {
    animation-delay: 0.4s;
}

.trending-card:nth-child(5) {
    animation-delay: 0.5s;
}

/* Responsividade */
@media (max-width: 768px) {

    /* Manter layout horizontal - título à esquerda, filtros à direita */
    .trending-header .d-flex {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem;
    }

    .trending-header h5 {
        margin-bottom: 0 !important;
        font-size: 1.1rem;
    }

    /* Botões de filtro - apenas ícones */
    .trending-filter .filter-text {
        display: none;
    }

    .trending-filter i {
        margin: 0 !important;
        font-size: 1.1rem;
    }

    .trending-header .btn-group {
        display: flex;
        gap: 0.25rem;
        flex-shrink: 0;
    }

    .trending-header .btn-group .btn {
        border-radius: 0.5rem !important;
        min-width: 44px;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .trending-wrapper {
        padding: 15px;
    }

    .trending-container {
        padding: 1rem;
    }

    .trending-card {
        width: 280px;
        min-width: 280px;
    }

    .trending-card__content {
        padding: 1.2rem;
        min-height: 260px;
    }

    .trending-card__title {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        min-height: 2.8rem;
    }

    .trending-nav {
        width: 36px;
        height: 100px;
    }
}

/* =========================================
   Blue Palette & White Background Overrides
   ========================================= */

body {
    background-color: #ffffff !important;
    color: #2c4a6b;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: #0f3460 !important;
    /* Deep Royal Blue */
}

.text-dark {
    color: #0f3460 !important;
}

.text-muted {
    color: #536b88 !important;
    /* Blue-ish Gray */
}

.text-secondary {
    color: #536b88 !important;
}

/* Update card backgrounds and borders for blue theme */
.stories-container,
.trending-container {
    background: #f0f7ff;
    /* Very light blue */
    border-color: #dbeafe;
}

.trending-card {
    background: #ffffff;
    border-color: #dbeafe;
}

.trending-card__content {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.trending-card__title {
    color: #16213e;
    /* Dark Blue */
}

.trending-card__author,
.stat-item {
    color: #4a6fa5;
}

.story-card__title {
    color: #ffffff;
    /* Keep white on image overlay */
}

/* Adjust icons to match */
.bi-fire.text-danger {
    color: #e94560 !important;
    /* Keep accent but maybe adjust if needed, user said fonts blue */
}

.bi-grid-fill.text-primary {
    color: #0d6efd !important;
    /* Bootstrap primary is already blue */
}

/* Ensure story card text is WHITE */
.story-card__title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.story-card__content {
    color: #ffffff !important;
}

/* Featured Page Cards */
.featured-page-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.featured-page-card i {
    transition: transform 0.3s ease;
}

.featured-page-card:hover i {
    transform: scale(1.1);
}