/* ============================================
   INDEX PAGE STYLES
   Styles specific to the main homepage
   ============================================ */

/* Mobile styles for main page elements */
@media (max-width: 767px) {
    .main-container {
        padding: 0 10px;
    }

    .fresh-articles,
    .featured-articles,
    .news-list {
        margin-bottom: 20px;
    }

    .fresh-article,
    .featured-article,
    .news-item-list {
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .fresh-image,
    .featured-image,
    .news-image-list {
        max-height: 150px;
        object-fit: cover;
        width: 100%;
    }

    .fresh-content,
    .featured-content,
    .news-content-list {
        padding: 12px;
    }

    .fresh-title,
    .featured-title,
    .news-title-list {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .fresh-summary,
    .featured-summary,
    .news-summary-list {
        font-size: 14px;
        line-height: 1.4;
        color: #666;
        margin-bottom: 8px;
    }

    .fresh-time,
    .featured-date,
    .news-date-list {
        font-size: 12px;
        color: #888;
    }

    .news-grid-mobile {
        display: block;
    }

    .news-item-mobile {
        padding: 12px 0;
    }

    .news-image-mobile {
        width: 80px;
        height: 60px;
        object-fit: cover;
        float: left;
        margin-right: 10px;
    }

    .news-content-mobile {
        overflow: hidden;
    }

    .news-title-mobile {
        font-size: 16px;
        line-height: 1.3;
        margin-bottom: 3px;
    }

    .news-date-mobile {
        font-size: 12px;
        color: #888;
    }

    .news-separator {
        margin: 8px 0;
    }

    .lottery-widgets-section {
        margin-bottom: 25px;
    }

    /* Lottery Grid Styles for Mobile */
    .lottery-grid-container {
        position: relative;
    }

    .lottery-grid-row {
        position: relative;
    }

    .lottery-grid-item {
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Hidden lottery cards - collapsed but rendered */
    .lottery-grid-item.collapsed {
        display: block;
        opacity: 0;
        height: 0;
        overflow: hidden;
        transform: translateY(-20px);
        transition: opacity 0.5s ease, height 0.5s ease, transform 0.5s ease;
    }

    .lottery-grid-item.collapsed.revealed {
        opacity: 1;
        height: auto;
        transform: translateY(0);
    }

    /* Overlay container that covers hidden items */
    .lottery-overlay-wrapper {
        position: relative;
        left: 0;
        right: 0;
        height: auto;
        pointer-events: none;
        z-index: 10;
        margin-top: -150px;
        padding-top: 150px;
    }

    .lottery-overlay-wrapper.hidden {
        display: none;
    }

    .lottery-overlay-gradient {
        position: absolute;
        bottom: 60px;
        left: 0;
        right: 0;
        height: 150px;
        background: linear-gradient(to bottom,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.7) 40%,
                rgba(255, 255, 255, 0.95) 70%,
                rgba(255, 255, 255, 1) 100%);
        pointer-events: none;
        z-index: 10;
    }

    .lottery-overlay {
        position: relative;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        pointer-events: all;
        z-index: 11;
        padding: 20px 0;
    }

    .lottery-show-more {
        background: linear-gradient(135deg, #00ff87, #60efff);
        color: #1a1a2e;
        border: none;
        padding: 15px 40px;
        font-size: 1.1em;
        font-weight: 600;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 255, 135, 0.3);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .lottery-show-more:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 255, 135, 0.4);
    }

    .lottery-show-more .arrow-down {
        transition: transform 0.3s ease;
    }

    .lottery-show-more:hover .arrow-down {
        transform: translateY(3px);
    }

    .lottery-view-all {
        text-align: center;
        margin-top: 30px;
    }

    .lottery-view-all-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: #1a1a2e;
        color: white;
        padding: 15px 40px;
        border-radius: 50px;
        text-decoration: none;
        font-size: 1.1em;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
    }

    .lottery-view-all-btn:hover {
        background: linear-gradient(135deg, #00ff87, #60efff);
        color: #1a1a2e;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 255, 135, 0.4);
    }

    .lottery-view-all-btn .arrow-right {
        transition: transform 0.3s ease;
    }

    .lottery-view-all-btn:hover .arrow-right {
        transform: translateX(5px);
    }

    .lottery-show-more,
    .lottery-view-all-btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    .fresh-label,
    .hot-label,
    .news-label {
        font-size: 22px;
        padding: 8px 0;
        margin: 20px 0 12px;
    }

    .ad-sidebar {
        display: none;
    }

    .mobile-ad {
        margin: 20px 0;
    }

    .mobile-ad-banner img {
        width: 100%;
        height: auto;
        max-height: 100px;
        object-fit: contain;
    }

    .pagination {
        margin: 20px 0;
    }
}

@media (min-width: 768px) {
    .news-grid-mobile {
        display: none;
    }

    /* Desktop lottery grid styles */
    .lottery-grid-container {
        position: relative;
    }

    .lottery-grid-item {
        transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .lottery-grid-item.collapsed {
        display: block;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transform: translateY(-20px);
        transition: opacity 0.5s ease, max-height 0.5s ease, transform 0.5s ease, margin 0.5s ease;
        margin-bottom: 0;
    }

    .lottery-grid-item.collapsed.revealed {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
        margin-bottom: 1.5rem;
    }

    .lottery-overlay-wrapper {
        position: relative;
        margin-top: -180px;
        padding-top: 180px;
        pointer-events: none;
        z-index: 10;
    }

    .lottery-overlay-wrapper.hidden {
        display: none;
    }

    .lottery-overlay-gradient {
        position: absolute;
        bottom: 70px;
        left: 0;
        right: 0;
        height: 150px;
        background: linear-gradient(to bottom,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.5) 30%,
                rgba(255, 255, 255, 0.85) 60%,
                rgba(255, 255, 255, 1) 100%);
        pointer-events: none;
        z-index: 10;
    }

    .lottery-overlay {
        position: relative;
        text-align: center;
        pointer-events: all;
        z-index: 11;
        padding: 20px 0;
    }

    .lottery-show-more {
        background: linear-gradient(135deg, #00ff87, #60efff);
        color: #1a1a2e;
        border: none;
        padding: 15px 40px;
        font-size: 1.1em;
        font-weight: 600;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 255, 135, 0.3);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .lottery-show-more:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 255, 135, 0.4);
    }

    .lottery-show-more .arrow-down {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .lottery-show-more:hover .arrow-down {
        transform: translateY(3px);
    }

    .lottery-view-all {
        text-align: center;
        margin-top: 30px;
    }

    .lottery-view-all-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: #1a1a2e;
        color: white;
        padding: 15px 40px;
        border-radius: 50px;
        text-decoration: none;
        font-size: 1.1em;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
    }

    .lottery-view-all-btn:hover {
        background: linear-gradient(135deg, #00ff87, #60efff);
        color: #1a1a2e;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 255, 135, 0.4);
        text-decoration: none;
    }

    .lottery-view-all-btn .arrow-right {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .lottery-view-all-btn:hover .arrow-right {
        transform: translateX(5px);
    }
}

/* Articles Carousel Styles */
.articles-carousel-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 15px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.carousel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #1a1a2e;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: white;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(26, 26, 46, 0.3) 0%,
            rgba(26, 26, 46, 0.5) 50%,
            rgba(26, 26, 46, 0.9) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.carousel-card:hover::before {
    background: linear-gradient(to bottom,
            rgba(26, 26, 46, 0.4) 0%,
            rgba(26, 26, 46, 0.6) 50%,
            rgba(26, 26, 46, 0.95) 100%);
}

.carousel-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.carousel-content h3 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    line-height: 1.3;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-content p {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.carousel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.carousel-date {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.carousel-category {
    background: linear-gradient(135deg, #00ff87, #60efff);
    color: #1a1a2e;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 46, 0.8);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2.5em;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.carousel-btn:hover {
    background: rgba(0, 255, 135, 0.9);
    color: #1a1a2e;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: -30px;
}

.carousel-next {
    right: -30px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: linear-gradient(135deg, #00ff87, #60efff);
    width: 35px;
    border-radius: 6px;
}

/* Carousel responsive styles */
@media (max-width: 1024px) {
    .carousel-card {
        height: 350px;
    }

    .carousel-btn {
        width: 50px;
        height: 50px;
        font-size: 2em;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-content {
        padding: 20px;
    }

    .carousel-content h3 {
        font-size: 1.5em;
    }

    .carousel-content p {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .articles-carousel-section h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .carousel-card {
        height: 300px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }

    .carousel-content {
        padding: 20px;
    }

    .carousel-content h3 {
        font-size: 1.3em;
    }

    .carousel-content p {
        font-size: 0.95em;
    }
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
