 /* --- RESET & BASE STYLES --- */
 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
 }

 body {
     background: url("../images/login-bg.jpg");
     color: #333;
     overflow-x: hidden;

     display: flex;
     flex-direction: column;
     min-height: 100vh;
 }

 /* --- NEWS DETAIL PAGE --- */
 .detail-wrapper {
     max-width: 800px;
     margin: 0 auto;
     background-color: #fffde7;
     border: 2px solid #000;
     border-radius: 8px;
     padding: 30px;
     max-height: 700px;
     overflow-y: auto;
     /* Scroll feature for extra long dynamic descriptions */
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
 }

 .back-link {
     display: inline-block;
     margin-bottom: 15px;
     color: #2979ff;
     font-weight: bold;
     cursor: pointer;
     text-decoration: underline;
 }

 .detail-title {
     font-size: 2.2rem;
     color: #4a148c;
     margin-bottom: 10px;
     line-height: 1.2;
 }

 .detail-date {
     font-size: 0.95rem;
     color: #666;
     margin-bottom: 20px;
     font-style: italic;
     border-bottom: 2px solid #ffd54f;
     padding-bottom: 10px;
 }

 .detail-body {
     font-size: 1.1rem;
     line-height: 1.7;
     color: #333;
 }

 .detail-body p {
     margin-bottom: 15px;
 }

 /* --- NAVBAR SECTION --- */
 header {
     background-color: rgb(217 223 117 / 23%);
     position: sticky;
     top: 0;
     z-index: 1000;
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
 }

 .nav-container {
     max-width: 1200px;
     margin: 0 auto;
     display: flex;
     justify-content: center;
     align-items: center;
     padding: 5px 20px;
     position: relative;
 }

 .nav-menu {
     display: flex;
     list-style: none;
     gap: 15px;
     align-items: center;
 }

 .logo-container {
     margin: 0 30px;
     z-index: 10;
 }

 .logo {
     width: 70px;
     height: 70px;
     background: url('../images/logo.png');
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     font-weight: bold;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
     transition: transform 0.3s ease;
 }

 .logo:hover {
     transform: scale(1.1) rotate(5deg);
 }

 .nav-item {
     position: relative;
 }

 .nav-btn {
     background-color: #4a148c;
     color: white;
     border: none;
     padding: 12px 20px;
     cursor: pointer;
     font-weight: 600;
     border-radius: 4px;
     transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
     display: block;
 }

 /* Nav Menu Hover Effect: Extends downwards */
 .nav-item:hover .nav-btn {
     padding-bottom: 25px;
     background-color: #7b1fa2;
     border-radius: 4px 4px 0 0;
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
 }

 /* --- BANNER SECTION --- */
 .banner {
     background: url('../images/banner.jpg') center no-repeat;
     height: 600px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 2.5rem;
     font-weight: bold;
     color: #4a148c;
     text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
     animation: fadeIn 1.5s ease-out;
     padding-top: -20px;
 }

 /* --- SECTION 1: BLUE IMAGE GALLERY --- */
 .sec-gallery {
     background: url('../images/section-bg-1.jpg');
     padding: 60px 20px;
     position: relative;
     background-size: cover;
     background-position: center;
 }

 .gallery-container {
     max-width: 1200px;
     margin: 0 auto;
     display: grid;
     grid-template-columns: repeat(7, 1fr);
     gap: 15px;
     align-items: center;
 }

 .gallery-card {
     color: white;
     height: 250px;
     display: flex;
     align-items: center;
     justify-content: center;
     border: 2px solid #000;
     font-weight: bold;
     border-radius: 6px;
     transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
     cursor: pointer;
 }

 /* Image hover effect: moves up a little bit */
 .gallery-card:hover {
     transform: translateY(-15px);
     box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
     background-color: #7c4dff;
 }

 .center-download-block {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 15px;
     position: relative;
     z-index: 5;
 }

 .download-btn {
     width: 140px;
     height: 140px;
     background: url('../images/download-button.png');
     background-size: contain;
     border-radius: 50%;
     border: none;
     color: white;
     font-size: 0.75rem;
     font-weight: bold;
     text-align: center;
     text-transform: uppercase;
     cursor: pointer;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 5px;
 }

 .download-btn:hover {
     transform: scale(1.15);
     background: url('../images/download-button-hover.png');
     background-size: contain;
     box-shadow: 0 8px 20px rgba(255, 94, 94, 0.4);
 }

 .donate-btn {
     width: 140px;
     height: 140px;
     background: url('../images/donate-button.png');
     background-size: contain;
     border-radius: 50%;
     border: none;
     color: white;
     font-size: 0.75rem;
     font-weight: bold;
     text-align: center;
     text-transform: uppercase;
     cursor: pointer;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 5px;
 }

 .donate-btn:hover {
     transform: scale(1.15);
     background: url('../images/donate-button-hover.png');
     background-size: contain;
     box-shadow: 0 8px 20px rgba(255, 94, 94, 0.4);
 }

 .center-image {
     background-color: #ccff90;
     width: 100%;
     height: 120px;
     border: 2px solid #000;
     display: flex;
     align-items: center;
     justify-content: center;
     font-weight: bold;
     color: #33691e;
     border-radius: 4px;
 }

 /* --- SECTION 2: ORANGE NEWS & VIDEO --- */
 .sec-news {
     background: url('../images/section-bg-2.jpg');
     padding: 50px 20px;
     border-top: 10px solid #fff;
     background-size: cover;
     background-position: center;
 }

 .news-container {
     max-width: 1200px;
     margin: 0 auto;
     display: grid;
     grid-template-columns: 1.2fr 1fr;
     gap: 30px;
 }

 .video-block {
     background-color: #fffde7;
     border: 2px solid #000;
     border-radius: 8px;
     min-height: 350px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.5rem;
     font-weight: bold;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
 }

 .tabs-wrapper {
     display: flex;
     flex-direction: column;
 }

 .tab-menu {
     display: grid;
     grid-template-columns: repeat(4, 1fr);
     gap: 2px;
 }

 .tab-btn {
     background-color: #2979ff;
     color: white;
     border: 2px solid #000;
     border-bottom: none;
     padding: 10px 5px;
     font-size: 0.85rem;
     font-weight: 600;
     cursor: pointer;
     text-align: center;
     border-radius: 4px 4px 0 0;
     transition: background 0.2s, color 0.2s;
 }

 /* Style for inactive tabs to look distinct */
 .tab-btn {
     background-color: #1565c0;
     color: #bbdefb;
 }

 .tab-btn.active, .tab-btn:hover {
     background-color: #2979ff;
     color: white;
 }

 .news-list-box {
     background-color: #2979ff;
     border: 2px solid #000;
     padding: 15px;
     flex-grow: 1;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     min-height: 300px;
     border-radius: 0 0 6px 6px;
 }

 /* Hide content segments by default */
 .tab-content {
     display: none;
     flex-direction: column;
     justify-content: space-between;
     height: 100%;
     gap: 10px;
 }

 /* Show the active content segment */
 .tab-content.active {
     display: flex;
     animation: fadeIn 0.4s ease-out;
 }

 .news-item {
     background-color: rgba(255, 255, 255, 0.15);
     color: white;
     padding: 12px 15px;
     border-radius: 4px;
     font-weight: 500;
     border-left: 4px solid #fff;
     transition: transform 0.2s;
 }

 .news-item:hover {
     transform: translateX(8px);
     background-color: rgba(255, 255, 255, 0.25);
 }

 /* --- SECTION 3: ORANGE LEADERBOARD --- */
 .sec-rank {
     background: url('../images/section-bg-3.jpg');
     padding: 50px 20px;
     border-top: 10px solid #fff;
     background-size: cover;
     background-position: center;
 }

 .rank-container {
     max-width: 1200px;
     margin: 0 auto;
     display: grid;
     grid-template-columns: 250px 1fr;
     gap: 30px;
 }

 .title-aside {
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.8rem;
     font-weight: bold;
     color: #33691e;
     max-height: 400px;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
 }

 .rank-table-box {
     display: flex;
     flex-direction: column;
 }

 /* Set up tab colors matching rank table */
 .rank-table-box .tab-btn {
     background-color: #4a148c;
     color: #e1bee7;
 }

 .rank-table-box .tab-btn.active, .rank-table-box .tab-btn:hover {
     background-color: #651fff;
     color: white;
 }

 .rank-table {
     width: 100%;
     background-color: #651fff;
     border-collapse: collapse;
     border: 2px solid #000;
     color: white;
     border-radius: 0 0 6px 6px;
     overflow: hidden;
 }

 .rank-table th, .rank-table td {
     padding: 10px 15px;
     text-align: left;
     border-bottom: 1px solid rgba(255, 255, 255, 0.1);
 }

 .rank-table th {
     background-color: #4a148c;
     font-weight: bold;
 }

 .rank-table tr:hover td {
     background-color: rgba(255, 255, 255, 0.1);
     cursor: pointer;
 }

 /* --- CONTENT MAIN WRAPPER --- */
 main {
     flex-grow: 1;
     padding: 40px 20px;
     animation: pageFade 0.4s ease-out;
 }

 .form-wrapper {
     background-color: #ffffff;
     max-width: 450px;
     margin: 0 auto;
     padding: 35px;
     border: 2px solid #000;
     border-radius: 8px;
     box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
 }

 .form-wrapper h2 {
     color: black;
     margin-bottom: 20px;
     text-align: center;
     font-size: 1.8rem;
 }

 .input-group {
     margin-bottom: 15px;
 }

 .input-group label {
     display: block;
     color: black;
     font-weight: 600;
     margin-bottom: 5px;
     font-size: 0.9rem;
 }

 .input-group input {
     width: 100%;
     padding: 12px;
     border: 2px solid #000;
     border-radius: 4px;
     font-size: 1rem;
     outline: none;
 }

 .submit-btn {
     width: 100%;
     background-color: #4a148c;
     color: black;
     border: 2px solid #000;
     padding: 14px;
     font-size: 1.1rem;
     font-weight: bold;
     cursor: pointer;
     border-radius: 4px;
     margin-top: 10px;
     transition: background 0.2s;
 }

 .submit-btn:hover {
     background-color: #2a085c;
 }

 .popup-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.6);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 2000;
     opacity: 0;
     pointer-events: none;
     transition: opacity 0.3s;
 }

 .popup-overlay.popup-open {
     opacity: 1;
     pointer-events: auto;
 }

 .popup-box {
     background-color: white;
     border: 3px solid #000;
     padding: 30px;
     border-radius: 8px;
     width: 90%;
     max-width: 400px;
     text-align: center;
     transform: scale(0.8);
     transition: transform 0.3s;
 }

 .popup-overlay.popup-open .popup-box {
     transform: scale(1);
 }

 .popup-status-icon {
     font-size: 3.5rem;
     margin-bottom: 10px;
     color: #f44336;
 }

 .popup-title {
     font-size: 1.5rem;
     font-weight: bold;
     margin-bottom: 10px;
 }

 .popup-msg {
     color: #555;
     margin-bottom: 20px;
 }

 .popup-close-btn {
     background-color: #000;
     color: white;
     border: none;
     padding: 10px 25px;
     font-weight: bold;
     cursor: pointer;
     border-radius: 4px;
 }

 footer {
     background-color: #fffbdf;
     text-align: center;
     padding: 40px 20px;
     font-size: 1.2rem;
     font-weight: bold;
     color: #555;
     border-top: 5px solid #e0e0e0;
     margin-top: auto;
 }

 /* --- ANIMATION EFFECTS --- */
 @keyframes fadeIn {
     from {
         opacity: 0;
         transform: translateY(5px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 /* --- RESPONSIVE DESIGN (MEDIA QUERIES) --- */
 @media (max-width: 1024px) {
     .gallery-container {
         grid-template-columns: repeat(4, 1fr);
     }

     .center-download-block {
         grid-column: span 2;
         order: -1;
     }

     .rank-container {
         grid-template-columns: 1fr;
     }

     .title-aside {
         min-height: 80px;
     }
 }

 @media (max-width: 768px) {
     .nav-container {
         flex-direction: column;
         gap: 15px;
     }

     .logo-container {
         order: -1;
         margin: 10px 0;
     }

     .nav-menu {
         flex-wrap: wrap;
         justify-content: center;
     }

     .gallery-container {
         grid-template-columns: repeat(2, 1fr);
     }

     .center-download-block {
         grid-column: span 2;
     }

     .news-container {
         grid-template-columns: 1fr;
     }
 }

 @media (max-width: 480px) {
     .gallery-container {
         grid-template-columns: 1fr;
     }

     .center-download-block {
         grid-column: span 1;
     }

     .tab-menu {
         grid-template-columns: repeat(2, 1fr);
         gap: 5px;
     }
 }

 main { flex-grow: 1; padding: 40px 20px; }
        
        /* --- SCROLLABLE NEWS BODY PANEL --- */
        .detail-wrapper { max-width: 800px; margin: 0 auto; background-color: #fffde7; border: 2px solid #000; border-radius: 8px; padding: 30px; max-height: 550px; overflow-y: auto; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
        .back-link { display: inline-block; margin-bottom: 15px; color: #2979ff; font-weight: bold; text-decoration: underline; cursor: pointer; }
        .detail-title { font-size: 2.2rem; color: #4a148c; margin-bottom: 10px; line-height: 1.2; }
        .detail-date { font-size: 0.95rem; color: #666; margin-bottom: 20px; font-style: italic; border-bottom: 2px solid #ffd54f; padding-bottom: 10px; }
        .detail-body { font-size: 1.1rem; line-height: 1.7; color: #333; }
        .detail-body p { margin-bottom: 15px; }