/* Mobile-First Responsive CSS */
body {
    position: relative;
    margin: 0;
    font-family: 'Muli', sans-serif;
    color: #fff;
    background-color: #000;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.637), rgba(0, 0, 0, 0.5)),
        url('https://i.postimg.cc/1t8Cxjmw/BACKGROUND-HALsdfa.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: scroll;
    min-height: 100vh;
}

@media (min-width: 769px) {
    body {
        background-attachment: fixed;
    }
}

/* ========== NAVBAR ========== */
.navbar {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 100;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.navbar a {
    display: inline-block;
    text-decoration: none;
    background-image: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    padding: 12px 25px;
    border-radius: 25px;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 14px;
    transition: all 0.2s ease-out;
    text-align: center;
    width: 85%;
    max-width: 250px;
    box-sizing: border-box;
}

.navbar a:hover {
    transform: scale(1.02);
    background-image: linear-gradient(to bottom, #7a33ff 0%, #7a33ff 100%);
}

/* Tablet dan Desktop Navbar */
@media (min-width: 768px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 20px;
    }

    .nav-links {
        flex-direction: row;
        width: auto;
    }

    .navbar a {
        width: auto;
        border-radius: 60px 20px 60px 20px;
        font-size: 16px;
        padding: 10px 20px;
    }

    .navbar a:hover {
        transform: scale(1.05);
    }
}

/* ========== CONTAINER ========== */
.container {
    max-width: 95%;
    margin: 10px auto 20px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 1px solid #585656;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .container {
        max-width: 960px;
        margin: 20px auto 40px;
        padding: 20px;
    }
}

/* ========== CAROUSEL ========== */
.carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel img {
    width: 100%;
    flex-shrink: 0;
    height: auto;
    object-fit: cover;
    min-height: 200px;
    max-height: 300px;
}

.carousel-buttons {
    text-align: center;
    margin-top: 10px;
    padding: 0 10px;
}

.carousel-buttons button {
    padding: 8px 15px;
    border: none;
    background: #9003d1;
    color: #fff;
    border-radius: 20px;
    margin: 5px;
    cursor: pointer;
    font-size: 14px;
    min-width: 50px;
}

.carousel-buttons button:hover {
    background: #6f00ff;
}

@media (min-width: 768px) {
    .carousel {
        border-radius: 12px;
    }

    .carousel img {
        min-height: 300px;
        max-height: 400px;
    }
}

/* ========== HOME BUTTON ========== */
.home-button {
    display: inline-block;
    background-image: linear-gradient(to right, #6f00ff, #9003d1);
    color: #fff;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
    margin: 10px auto;
    display: block;
}

.home-button:hover {
    background-image: linear-gradient(to right, #8229ff, #a54de2);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .home-button {
        display: inline-block;
        width: auto;
        margin: 0;
        border-radius: 10px;
    }
}

/* ========== ORTU SECTION ========== */
.ortu {
    text-align: center;
    padding: 15px 10px;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 -5px 20px rgba(144, 3, 209, 0.5);
    border: 1px solid #585656;
    background-image: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    border-radius: 25px;
    margin: 10px 0;
}

@media (min-width: 768px) {
    .ortu {
        font-size: 20px;
        padding: 20px 10px;
        border-radius: 60px 2px 60px 2px;
    }
}

/* ========== NAVIGATION BUTTONS ========== */
.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.nav-buttons button {
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    background-image: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    width: 100%;
    box-sizing: border-box;
}

.nav-buttons button a {
    text-decoration: none;
    color: #fff;
    display: block;
}

.nav-buttons button:hover {
    background: linear-gradient(to right, #d400ff, #d400ff);
    transform: translateY(-1px);
}

@media (min-width: 768px) {
    .nav-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 30px;
        padding: 0;
    }

    .nav-buttons button {
        padding: 15px 50px;
        border-radius: 60px 10px 60px 5px;
        font-size: 16px;
        width: auto;
        min-width: 200px;
    }
}

/* ========== MONTH BUTTONS ========== */
.month-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-width: 100%;
    margin: 0 auto 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.month-buttons a {
    display: block;
    padding: 12px 8px;
    background-image: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    border-radius: 15px;
    text-decoration: none;
    font-size: 12px;
    text-align: center;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    color: #ffffff;
    transition: all 0.3s ease;
}

.month-buttons a:hover {
    color: #fff;
    background: linear-gradient(135deg, #eeff00, #eeff00);
    box-shadow: 0 0 12px rgba(63, 251, 0, 0.7);
    transform: translateY(-2px);
}

@media (min-width: 480px) {
    .month-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .month-buttons a {
        font-size: 13px;
        padding: 10px 6px;
    }
}

@media (min-width: 768px) {
    .month-buttons {
        max-width: 600px;
        gap: 10px;
    }

    .month-buttons a {
        border-radius: 10px;
    }
}

/* ========== MAYA THIDUP TABLE ========== */
.mayathidup-tabel {
    width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    box-sizing: border-box;
    padding: 0 5px;
}

.mayathidup-tabel h3 {
    text-align: center;
    font-size: 14px;
    margin-bottom: 10px;
    color: #ffffff;
    background: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    border-radius: 15px;
    box-shadow: 0 0 8px rgba(230, 111, 0, 0.4);
    padding: 10px 8px;
    line-height: 1.3;
    transition: all 0.3s ease-in-out;
}

.mayathidup-tabel table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #d4af37;
    font-size: 10px;
    min-width: 300px;
}

.mayathidup-tabel th,
.mayathidup-tabel td {
    border: 1px solid #ffffff;
    padding: 6px 3px;
    text-align: center;
    color: #fff3d9;
    word-wrap: break-word;
    font-size: 10px;
}

.mayathidup-tabel th {
    background: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    font-weight: bold;
    color: #fff3d9;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
    padding: 8px 5px;
}

@media (min-width: 480px) {
    .mayathidup-tabel h3 {
        font-size: 16px;
    }

    .mayathidup-tabel table {
        font-size: 12px;
    }

    .mayathidup-tabel th,
    .mayathidup-tabel td {
        padding: 8px 5px;
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .mayathidup-tabel {
        padding: 0;
    }

    .mayathidup-tabel h3 {
        font-size: 18px;
        border-radius: 20px;
        padding: 6px 10px;
    }

    .mayathidup-tabel table {
        font-size: 14px;
        min-width: unset;
    }

    .mayathidup-tabel th,
    .mayathidup-tabel td {
        padding: 10px 6px;
        font-size: 16px;
    }

    .mayathidup-tabel th {
        padding: 20px;
    }
}

/* ========== CLAIM BUTTON ========== */
.claim-button {
    background: linear-gradient(135deg, #ab06d4, #d404caad);
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 10px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 60px;
    box-sizing: border-box;
}

.claim-button:hover {
    background: linear-gradient(135deg, #b700ff, #b700ff, #b700ff);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    transform: translateY(-1px);
}

@media (min-width: 480px) {
    .claim-button {
        font-size: 11px;
        padding: 6px 15px;
        min-width: 70px;
    }
}

@media (min-width: 768px) {
    .claim-button {
        padding: 6px 20px;
        border-radius: 6px;
        font-size: 12px;
        min-width: 90px;
    }
}

/* ========== LEADERBOARD TABLE ========== */
.leaderboard-table {
    border-radius: 10px;
    padding: 10px 5px;
    margin: 20px auto;
    overflow-x: auto;
    color: #fff;
    text-align: center;
    box-sizing: border-box;
}

.leaderboard-table table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 10px;
    text-align: center;
    min-width: 300px;
}

.leaderboard-table thead th {
    background-image: linear-gradient(to bottom, #6f00ff 0%, #9003d1 100%);
    color: #e9ffd9;
    padding: 10px 5px;
    border: 1px solid #ffffff;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    box-shadow: 0 0 6px rgba(46, 230, 0, 0.4);
    transition: all 0.3s ease-in-out;
}

.leaderboard-table tbody td {
    background: #000000;
    color: #ffffff;
    padding: 8px 4px;
    border: 1px solid #ffffff;
    text-align: center;
    transition: background 0.3s ease;
    font-size: 10px;
}

.leaderboard-table tbody td:hover {
    background: #9500eb;
}

.leaderboard-table tbody td:last-child {
    font-weight: bold;
    color: #ffffff;
    box-shadow: inset 0 0 4px rgba(63, 251, 0, 0.3);
}

@media (min-width: 480px) {
    .leaderboard-table table {
        font-size: 11px;
    }

    .leaderboard-table thead th {
        font-size: 11px;
        padding: 12px 8px;
    }

    .leaderboard-table tbody td {
        font-size: 11px;
        padding: 8px 6px;
    }
}

@media (min-width: 768px) {
    .leaderboard-table {
        padding: 10px;
    }

    .leaderboard-table table {
        width: 80%;
        font-size: 13px;
        min-width: unset;
    }

    .leaderboard-table thead th {
        font-size: 16px;
        padding: 20px;
    }

    .leaderboard-table tbody td {
        font-size: 12px;
        padding: 6px;
    }
}

/* ========== MARQUEE ========== */
.marquee-wrapper {
    max-width: 95%;
    margin: 10px auto;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    border-bottom: 5px solid #f700ffa9;
    box-sizing: border-box;
}

.marquee-wrapper marquee {
    display: block;
    padding-bottom: 8px;
    position: relative;
    font-size: 12px;
}

.marquee-wrapper marquee::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: #f700ffa9;
}

@media (min-width: 768px) {
    .marquee-wrapper {
        max-width: 900px;
        margin: 0 auto;
        padding: 10px 20px;
        border-radius: 20px;
        border-bottom: 7px solid #f700ffa9;
    }

    .marquee-wrapper marquee {
        padding-bottom: 10px;
        font-size: 14px;
    }

    .marquee-wrapper marquee::after {
        height: 3px;
    }
}

/* ========== UTILITY CLASSES ========== */
/* Text Responsif */
.text-xs {
    font-size: 10px;
}

.text-sm {
    font-size: 12px;
}

.text-base {
    font-size: 14px;
}

.text-lg {
    font-size: 16px;
}

.text-xl {
    font-size: 18px;
}

@media (min-width: 768px) {
    .text-xs {
        font-size: 12px;
    }

    .text-sm {
        font-size: 14px;
    }

    .text-base {
        font-size: 16px;
    }

    .text-lg {
        font-size: 18px;
    }

    .text-xl {
        font-size: 20px;
    }
}

/* Spacing Responsif */
.p-xs {
    padding: 5px;
}

.p-sm {
    padding: 10px;
}

.p-base {
    padding: 15px;
}

.p-lg {
    padding: 20px;
}

.m-xs {
    margin: 5px;
}

.m-sm {
    margin: 10px;
}

.m-base {
    margin: 15px;
}

.m-lg {
    margin: 20px;
}

/* Grid Responsif */
.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== FIXES UNTUK LAYAR SANGAT KECIL ========== */
@media (max-width: 320px) {
    .container {
        margin: 5px auto;
        padding: 10px;
    }

    .navbar {
        padding: 10px 5px;
    }

    .navbar a {
        padding: 10px 15px;
        font-size: 12px;
    }

    .mayathidup-tabel table,
    .leaderboard-table table {
        font-size: 9px;
        min-width: 280px;
    }

    .mayathidup-tabel th,
    .mayathidup-tabel td,
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 4px 2px;
        font-size: 9px;
    }

    .claim-button {
        padding: 4px 8px;
        font-size: 9px;
        min-width: 50px;
    }

    .month-buttons a {
        font-size: 11px;
        padding: 10px 6px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .navbar,
    .carousel-buttons,
    .nav-buttons,
    .home-button {
        display: none !important;
    }

    .container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
    }

    .mayathidup-tabel table,
    .leaderboard-table table {
        border: 1px solid #000 !important;
    }

    .mayathidup-tabel th,
    .mayathidup-tabel td,
    .leaderboard-table th,
    .leaderboard-table td {
        border: 1px solid #000 !important;
        background: white !important;
        color: black !important;
    }
}

/* ========== ACCESSIBILITY IMPROVEMENTS ========== */
/* Focus states untuk keyboard navigation */
.navbar a:focus,
.home-button:focus,
.nav-buttons button:focus,
.month-buttons a:focus,
.claim-button:focus,
.carousel-buttons button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Reduced motion untuk pengguna yang sensitif */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .carousel-track {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .navbar a,
    .home-button,
    .nav-buttons button,
    .month-buttons a,
    .claim-button {
        border: 2px solid #fff;
    }

    .mayathidup-tabel table,
    .leaderboard-table table {
        border: 2px solid #fff;
    }
}