/* Common Styles for All Pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    line-height: 1.6;
}

/* ============================================
   Header Styles
   ============================================ */
.header {
    background: #ffb019;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header img {
    width: 180px;
    height: 56px;
    object-fit: contain;
}

.back-button {
    position: absolute;
    left: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ============================================
   Copyright Footer
   ============================================ */
.copyright-footer {
    background: #ffac1a;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
    line-height: 1.6;
}

.copyright-footer p {
    margin: 5px 0;
}

.copyright-footer a {
    color: #ffcccc;
    text-decoration: none;
}

.copyright-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Legal Pages Specific Styles
   ============================================ */
.content-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 30px auto;
}

.content-box h1 {
    color: #ffac1a;
    margin-bottom: 10px;
    font-size: 32px;
}

.last-updated {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.content-box h2 {
    color: #ffac1a;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 24px;
}

.content-box h3 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.content-box p {
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

.content-box ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.content-box li {
    color: #333;
    margin-bottom: 8px;
}

/* ============================================
   Homepage - Top Section
   ============================================ */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================================
   Swiper/Carousel
   ==================================== */
.swiper-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.swiper-container:active {
    cursor: grabbing;
}

.swiper-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.swiper-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.swiper-dot.active {
    background: white;
}

.swiper-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.swiper-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s;
}

.swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================
   Recent News Section
   ===================== */
.recent-news {
    background: #a97a23;
    padding: 20px;
    border-radius: 8px;
    color: rgb(255, 255, 255);
}

.recent-news h2 {
    margin-bottom: 15px;
    font-size: 22px;
}

.recent-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: background 0.3s;
}

.recent-item:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 10px;
}

.recent-item:last-child {
    border-bottom: none;
}

/* ============================================
   Main Content Layout
   ============================================ */
.main-content {
    display: grid;
    grid-template-columns: 130px 1fr 130px;
    gap: 20px;
}

.ad-sidebar {
    background: #e0e0e0;
    height: 345px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    position: sticky;
    top: 20px;
}

.ad-sidebar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   News Grid
   ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.news-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-section h3 {
    background: #ffac2bf0;
    color: white;
    padding: 15px;
    margin: -20px -20px 15px -20px;
    border-radius: 8px 8px 0 0;
    font-size: 18px;
    flex-shrink: 0;
}

.news-list-container {
    overflow: hidden;
    position: relative;
    flex: 1;
    max-height: 900px;
}

.news-list-container > div {
    min-height: 200px;
}

.news-list-container.expanded {
    max-height: none;
    overflow: visible;
}

/* ============================================
   Expand Button
   ============================================ */
.expand-btn {
    background: #d9ac26;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: background 0.3s;
}

.expand-btn:hover {
    background: #f3af31;
}

/* ============================================
   News Articles
   ============================================ */
.news-article {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    width: 100%;
}

.news-article:last-child {
    border-bottom: none;
}

.news-thumbnail {
    width: 98px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    text-align: center;
}

.news-thumbnail.no-image::after {
    content: 'No Image';
}

.news-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.news-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-source {
    color: #4a6fa5;
    font-size: 12px;
    text-decoration: none;
}

.news-source:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #ffffff;
}

/* ============================================
   Mobile Bottom Ad
   ============================================ */
.mobile-bottom-ad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #e0e0e0;
    height: auto;
    max-height: 300px;
    align-items: center;
    justify-content: center;
    color: #666;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.mobile-bottom-ad.visible {
    opacity: 1;
}

.mobile-bottom-ad img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    body {
        padding-bottom: 300px;
    }

    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    .header {
        padding: 5px;
        border-radius: 0;
        width: 100%;
    }

    .back-button {
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .top-section {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
    }

    .swiper-container {
        border-radius: 0;
        min-height: 250px;
        padding: 20px;
        width: 100%;
    }

    .recent-news {
        border-radius: 0;
        width: 100%;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ad-sidebar {
        display: none;
    }

    .mobile-bottom-ad {
        display: flex;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .news-section {
        border-radius: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        width: 100%;
        padding: 15px;
        margin-bottom: 0;
    }

    .news-section:last-child {
        margin-bottom: 15px;
    }

    .news-list-container {
        min-height: auto;
    }

    .news-list-container > div {
        min-height: 100px;
    }

    .news-article {
        gap: 10px;
    }

    .news-thumbnail {
        width: 112px;
        height: 80px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-description {
        font-size: 12px;
    }

    .copyright-footer {
        margin-top: 20px;
        padding: 15px;
        font-size: 12px;
        margin-bottom: 300px;
    }

    /* Legal pages mobile */
    .content-box {
        padding: 20px 15px;
        border-radius: 0;
        margin: 15px auto;
    }

    .content-box h1 {
        font-size: 24px;
    }

    .content-box h2 {
        font-size: 20px;
    }

    .content-box h3 {
        font-size: 16px;
    }

    .content-box p,
    .content-box li {
        font-size: 14px;
    }
}
