/* === Layout Asas === */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  text-align: center;
  overflow-x: hidden; /* cegah scroll tepi */

  /* 🎨 Latar belakang */
  background-image: url("../images/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.container {
    max-width: 1000px;
    margin: 80px auto;
    background-color: #00000030;
    backdrop-filter: blur(8px);
    padding: 30px;
    border-radius: 25px;
    box-shadow: -1px -2px 5px #000000 inset, 0 2px 5px #ffffffb0 inset;
    color: white;
    text-align: left;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* === Header Admin (Kemas & Responsif) === */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 30px;
    background: #7d817e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden; /* cegah bayang tumpah */
}

header img {
    height: 45px;
    flex-shrink: 0;
}

header p {
    color: white;
    font-style: italic;
    padding-left: 10px;
    font-size: 13px;
    margin: 0;
}

header h1 {
    color: white;
    margin: 0;
    font-size: 40px;
    font-weight: bold;
    text-align: center;
    flex: 1;
    font-family: Georgia, serif;
    padding-right: 100px;
}

        #calendar { 
            position: relative;
            max-width: 75vw;
            margin: 30px auto;
            background-color: #00000030;
            backdrop-filter: blur(7px);
            padding: 20px;
            border-radius: 25px;
            box-shadow: -1px -2px 5px #000000 inset, 0 2px 5px #ffffffb0 inset;
        }
        .navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-family: "Monaco", monospace;
    color: white;
    font-size: 24px;
    padding: 10px 0 20px 0;
    text-shadow: 0 0 8px rgba(0,0,0,1);
    gap: 15px; /* bagi ruang sikit antara butang dan teks */
}

.navigation button {
    background: #f1c40f;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: -1px -1px 3px #00000080 inset, 1px 1px 3px #ffffffa0 inset;
}
.navigation button:hover {
    background: #d6ae0eff;
    box-shadow: -1px -1px 2px #00000050 inset, 1px 1px 2px #ffffff80 inset;
}


        .days2 { /*day names*/
            display: grid;
            font-family: "Monaco", monospace;
            font-size: 18px;
            grid-template-columns: repeat(7, 1fr);
            margin-top: 15px;
            margin-bottom: 10px;
            font-weight: bold;
            text-shadow: 0 0 10px rgba(0,0,0,1);
            color: #fff;
        }
        .day { /*date*/
            font-family: monospace;
            font-size: 16px;
            height: 150px;
            background-color: #fdf5e6; /*color: Old Lace*/
            border-radius: 7px;
            box-shadow: 0 0 2px #000000c0 inset;
            padding: 10px;
            text-align: left;
            overflow: hidden;
            position: relative;
            z-index: 1;
        }
        .today {
            background-color: #f1c40f;
            font-weight: bold;
            box-shadow: -1px -1px 3px #00000080 inset, 1px 2px 3px #ffffff80 inset;
        }
        
        /*unseen week layer*/
        .weeks { margin-top: 6px; position: relative; z-index: 0; }
        .week {
            position: relative;
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: none;
            margin-bottom: none;
            min-height: 150px;
        }

        /*muted == date from prev/next month*/
        .day.muted {
            color: white;
            font-family: monospace;
            font-size: 16px;
            font-weight: bold;
            background-color: #7d817ea0;
            box-shadow: 0 0 5px #00000090 inset;
            z-index: 10;
        }
        .todaymuted {
            color: white !important;
            font-weight: bold !important;
            text-shadow: 0 0 5px #000000a0 !important;
            background-color: #d6c27380 !important;
        }

        /*event bar layers*/
        .events-layer {
            position: absolute;
            left: 0; right: 0; top: 0; bottom: 0;
            pointer-events: none;
            z-index: 5;
        }
        .event-span {
            position: absolute;
            border-radius: 5px 5px 15px 5px;
            font-family: "Poppins", sans-serif;
            font-weight: bold;
            text-shadow: 1px 1px 3px #000000;
            font-size: 14px;
            color: white;
            box-shadow: 1px 1px 3px #000000a0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 1px;
            padding-left: 6px;
            line-height: 20px;
            text-align: left;
            pointer-events: auto;
        }

        /*drag up panel*/
        .legend-panel {
            position: fixed;
            bottom: 0px;
            width: 650px;
            right: 0px;
            background: rgba(255,255,255,0.5);
            border-top-left-radius: 40px;
            border-top-right-radius: 40px;
            transition: transform 0.4s ease;
            transform: translateY(93%);
            z-index: 1000;
            color: black;
            box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
        }
        .legend-panel:hover { transform: translateY(92%); }
        .legend-panel.open { transform: translateY(0px); }
        .legend-toggle { /*panel button*/
            padding: 4px;
            font-weight: bold;
            cursor: pointer;
            text-align: center;
            font-family: "Poppins", sans-serif;
            background: #f1c40f;
            border-top-left-radius: 50px;
            border-top-right-radius: 50px;
            box-shadow: 1px 2px 3px #ffffff80 inset, -1px 0 3px #00000080 inset;
        }
        #legendArrow {
            display: inline-block;
            transition: transform 0.3s ease;
            margin-left: 8px;
        }
        .legend-panel.open #legendArrow { transform: rotate(180deg); }
        
        /*panel content*/
        .legend-content {
            padding: 10px 30px; 
            background: #fff; 
            color: black; 
            text-align:left; 
            font-size:14px; 
            box-shadow: 0 2px 5px #0000003b inset;
            display:flex;
            flex-wrap:wrap;
            gap:6px;
        }
        .legend-color {
            display: inline-block;
            width: 15px; height: 15px; margin-right: 5px; border-radius: 10px;
            box-shadow: 0 1px 3px rgba(0,0,0,1);
        }

        /* simple tabs */
        .tabs { margin-top:8px; text-align:center; }
        .tabs button { padding:8px 14px; margin:0 6px; border-radius:8px; border:none; cursor:pointer; font-weight:bold; }
        .tabs .active { background:#f1c40f; color:#000; }
        .tabs button:not(.active) { background:#ddd; color:#222; }
        
        /* tooltip */
        #tooltip {
            position:fixed; display:none; pointer-events:none; z-index:2000;
            background:rgba(0,0,0,0.85); color:#fff; padding:8px 10px; border-radius:6px; font-size:13px;
            max-width:320px; white-space:normal;
        }
     /* === Admin Dropdown Menu (responsive & no scroll bug) === */


/* === Admin Dropdown Menu === */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* tambah supaya atas semua */
}

.dropbtn {
    background-color: #f1c40f;
    color: black;
    padding: 10px 16px;
    font-weight: bold;
    font-family: "Poppins", sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: -1px -1px 3px #00000080 inset, 1px 1px 3px #ffffffa0 inset;
    transition: all 0.3s ease;
}

.dropbtn:hover {
    background-color: #d6ae0e;
    transform: translateY(-2px);
}

.dropdown-content {
    display: none;
    position: fixed;
    right: 15px;
    top: 70px; /* ubah ikut tinggi header */
    background-color: rgba(255,255,255,0.98);
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    border-radius: 12px;
    z-index: 999999; /* paling atas */
    overflow: hidden;
}

.dropdown-content a {
    color: #000;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-weight: bold;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background-color: #f1c40f;
}

.dropdown-content a.logout {
    color: white;
    background-color: #e74c3c;
}

.dropdown-content a.logout:hover {
    background-color: #c0392b;
}

.dropdown-content.show {
    display: block;
}

/* === Responsive (skrin kecil) === */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    header h1 {
        padding-right: 0;
        font-size: 32px;
        margin-top: 8px;
    }

    .dropdown {
        margin-top: 8px;
    }
}

/* Pastikan body tak ada overflow */
body {
    margin: 0;
    overflow-x: hidden;
}
header {
    overflow: visible;
}
.footer {
  background: #00264d;
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
  border-top: 3px solid #f1c40f;
  margin-top: auto; /* pastikan dia di bawah */
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer a {
  color: #f1c40f;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .footer {
    font-size: 13px;
    padding: 20px 8px;
  }
}

/* === JKR Premium Header v3 === */
.jkr-header {
  background: linear-gradient(90deg, #9AB2F5, #87A4F5, #7395F5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border-bottom: 4px solid #a67c00;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.left-section {
  flex: 0 0 auto;
}

.center-section {
  flex: 1;
  text-align: center;
}

.right-section {
  flex: 0 0 auto;
  text-align: right;
}

/* === Logo Styling === */
.logo-wrapper {
  background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
  border-radius: 14px;
  padding: 6px;
  box-shadow: inset 0 2px 4px #ffffffa0, 0 2px 5px rgba(0,0,0,0.3);
  position: relative;
}

.logo-wrapper::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  height: 35%;
  background: linear-gradient(to top, rgba(255,255,255,0.5), transparent);
  border-radius: 10px;
  pointer-events: none;
}

.jkr-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.jkr-logo:hover {
  transform: scale(1.08);
}

/* === Text Styling === */
.center-section h1 {
  margin: 0;
  font-size: 2rem;
  font-family: "Georgia", serif;
  color: #222;
  letter-spacing: 0.8px;
  text-shadow: 1px 1px 2px #ffffffb0;
}

.center-section h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
  opacity: 0.9;
  letter-spacing: 0.4px;
}

.tagline {
  font-style: italic;
  color: #222;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 1px 1px 1px #ffffff90;
}

/* === Responsif (Mobile) === */
@media (max-width: 700px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .jkr-logo {
    width: 70px;
    height: 70px;
  }

  .center-section h1 {
    font-size: 1.5rem;
  }

  .center-section h2 {
    font-size: 1rem;
  }

  .tagline {
    font-size: 0.9rem;
  }
}


/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: white;
    font-size: 14px;
    text-align: left;
    min-width: 800px;
}
th, td {
    border: 1px solid #ffffff40;
    padding: 10px;
}
th {
    background: #7d817e;
    text-align: center;
}
tr:nth-child(even) { background: #ffffff15; }

/* BUTANG */
.actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.actions a, .actions button {
    display: block;
    width: 100%;
    text-align: center;
    background: #f1c40f;
    border: none;
    padding: 6px 0;
    border-radius: 8px;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.actions a.edit { background: #8cc7ff; }
.actions button { background: #ff8c8c; }
.actions a:hover, .actions button:hover { opacity: 0.9; }


.search {display:flex;gap:8px;align-items:center;}
.search input{padding:8px;border-radius:8px;border:1px solid #ccc;width:280px;}
.badge{padding:6px 8px;border-radius:6px;font-weight:bold;font-size:12px;}
.badge.active{background:#dff0d8;color:#21621b;}
.badge.inactive{background:#f9e0e0;color:#7a1212;}
.small{font-size:12px;color:#ccc;}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination a {
    color: #000;
    background: #f1c40f;
    border-radius: 6px;
    padding: 6px 12px;
    text-decoration: none;
    margin: 0 3px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.pagination a.active {
    background: #8cc7ff;
}
.pagination a:hover {
    background: #d6ae0e;
}

/* RESPONSIVE ADJUSTMENT */
@media (max-width: 700px) {
    header h1 {
        font-size: 22px;
        padding-right: 0;
    }
    .container {
        margin: 40px 15px;
        padding: 20px;
    }
    table {
        font-size: 12px;
        min-width: 600px;
    }
    .actions {
        flex-direction: column;
    }
    .actions a, .actions button {
        font-size: 12px;
        padding: 5px;
    }
}