/* ================= SPLASH SCREEN STYLE ================= */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000428, #004e92);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    transition: opacity 0.8s ease;
}

.splash-circle {
    width: 180px;
    height: 180px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: relative;
    margin: 0 auto 25px;
    animation: circlePulse 3s infinite alternate;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.logo-container {
    width: 75%;
    height: 75%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.svg-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 168, 255, 0.6));
    animation: logoFloat 4s infinite ease-in-out;
}

.splash-title {
    font-size: 32px;
    font-weight: bold;
    color: white;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow:
        0 0 10px #00a8ff,
        0 0 20px #00a8ff,
        0 0 30px #00a8ff;
    animation: textGlow 2s infinite alternate;
    line-height: 1.3;
}

.splash-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 3px;
    margin-bottom: 25px;
    text-transform: uppercase;
    font-weight: 300;
}

.splash-unit {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Tombol Pilihan di Splash Screen */
.splash-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.splash-btn {
    flex: 1;
    padding: 20px 25px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 120px;
}

.splash-btn i {
    font-size: 48px;
    transition: transform 0.3s ease;
}

.splash-btn span {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.splash-btn-dukops {
    background: linear-gradient(135deg, #2b4d2b, #3e704a);
    color: white;
    border: 2px solid #4CAF50;
}

.splash-btn-jadwal {
    background: linear-gradient(135deg, #006600, #008800);
    color: white;
    border: 2px solid #4dff4d;
}

.splash-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="14" fill="none" stroke="%234CAF50" stroke-width="2"/><path d="M16 6 L20 14 L28 14 L22 19 L24 27 L16 22 L8 27 L10 19 L4 14 L12 14 Z" fill="%234CAF50"/></svg>') 16 16, auto;
}

.splash-btn i:hover {
    transform: scale(1.1) rotate(10deg);
}

.splash-btn-dukops:hover {
    background: linear-gradient(135deg, #3e704a, #4CAF50);
    border-color: #66bb6a;
}

.splash-btn-jadwal:hover {
    background: linear-gradient(135deg, #008800, #00aa00);
    border-color: #66ff66;
}

.splash-progress-container {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 15px auto;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.splash-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00a8ff, #9c88ff, #ff6b9d);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.7);
    position: relative;
}

.progress-percentage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

/* ================= ANIMATIONS ================= */
@keyframes circlePulse {
    0% {
        box-shadow:
            0 0 20px rgba(0, 168, 255, 0.5),
            0 0 40px rgba(0, 168, 255, 0.3),
            inset 0 0 20px rgba(0, 168, 255, 0.1);
        transform: scale(1);
    }

    100% {
        box-shadow:
            0 0 30px rgba(156, 136, 255, 0.6),
            0 0 50px rgba(156, 136, 255, 0.4),
            inset 0 0 20px rgba(156, 136, 255, 0.2);
        transform: scale(1.05);
    }
}

@keyframes textGlow {
    0% {
        text-shadow:
            0 0 10px #00a8ff,
            0 0 20px #00a8ff,
            0 0 30px #00a8ff;
    }

    100% {
        text-shadow:
            0 0 15px #9c88ff,
            0 0 30px #9c88ff,
            0 0 45px #9c88ff;
        transform: translateY(-1px);
    }
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 8px rgba(0, 168, 255, 0.6));
    }

    50% {
        transform: translateY(-5px) scale(1.02);
        filter: drop-shadow(0 0 12px rgba(156, 136, 255, 0.8));
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ================= APP STYLE ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #101415;
    color: #f5f5f5;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    padding: 0;
    width: 100%;
}

.nav-btn {
    flex: 1;
    padding: 12px 15px;
    background: #2b4d2b;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #3e704a;
}

.nav-btn.active {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* DUKOPS Tab - Hijau */
.nav-btn-dukops {
    background: #1a3a1a;
    color: #9fd49f;
    border: 2px solid #4CAF50;
    border-right: 1px solid #4CAF50;
}

.nav-btn-dukops:hover {
    background: #2b5a2b;
}

.nav-btn-dukops.active {
    background: #4CAF50;
    color: #fff;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* PIKET Tab - Oranye */
.nav-btn-piket {
    background: #3a2a1a;
    color: #d4954a;
    border: 2px solid #d4954a;
    border-left: 1px solid #d4954a;
    border-right: 1px solid #d4954a;
}

.nav-btn-piket:hover {
    background: #4a3a2a;
}

.nav-btn-piket.active {
    background: #d4954a;
    color: #fff;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* ADMIN Tab - Biru/Cyan */
.nav-btn-admin {
    background: #1a2a3a;
    color: #4a9fd4;
    border: 2px solid #4a9fd4;
    border-left: 1px solid #4a9fd4;
}

.nav-btn-admin:hover {
    background: #2a3a4a;
}

.nav-btn-admin.active {
    background: #4a9fd4;
    color: #fff;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.nav-btn i {
    font-size: 16px;
}

.nav-btn.admin-btn {
    background: #d32f2f;
    flex: 0 1 auto;
}

.nav-btn.admin-btn:hover {
    background: #f44336;
    transform: translateY(-2px);
}

.nav-btn.admin-btn.active {
    background: #d32f2f;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.5);
}

.container {
    display: none;
    max-width: 600px;
    margin: auto;
    background: #202624;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #3a4f41;
    animation: fadeIn 0.5s ease-in;
}

.header-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3a4f41;
}

.header-image {
    height: 150px;
    width: 150px;
    border: 1px solid #3a4f41;
    border-radius: 5px;
    object-fit: contain;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-title {
    font-size: 16px;
    font-weight: bold;
    color: #b2d8b2;
    line-height: 1.3;
}

.header-subtitle {
    font-size: 12px;
    margin-top: 5px;
    color: #9fd49f;
}

label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #b2d8b2;
}

select,
input,
textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 5px;
    border: none;
    background: #333;
    color: #f5f5f5;
    font-size: 16px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    margin-top: 20px;
    padding: 12px 15px;
    background: #2b4d2b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    font-size: 16px;
}

button:hover:not(:disabled) {
    background: #3e704a;
}

button:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.7;
}

canvas {
    display: block;
    margin-top: 20px;
    width: 100%;
    height: auto;
    border: 1px solid #444;
    background: #000;
}

.previewBox {
    font-size: 14px;
    color: #a5a5a5;
    margin-top: 5px;
    min-height: 1em;
}

#logTerkirim {
    background: #1d1f1d;
    padding: 10px;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 14px;
    margin-top: 15px;
}

.counter-value {
    font-size: 60px;
    font-weight: bold;
    color: #9fd49f;
}

.log-entry {
    background: #2a3a2e;
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 13px;
}

.log-time {
    color: #b2d8b2;
    font-size: 12px;
}

.log-filename {
    font-weight: bold;
    color: #9fd49f;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    padding: 12px 15px;
    border-radius: 5px;
    z-index: 1000;
    font-size: 14px;
    text-align: center;
}

.notification.success {
    background: #4CAF50;
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #FF9800;
}

/* Tombol Absensi */
#showAttendanceBtn {
    background: #3a4f41;
    margin-top: 10px;
}

#showAttendanceBtn:hover {
    background: #4a6f5a;
}

/* Panel Absensi */
#attendancePanel {
    margin-top: 20px;
    background: #1d1f1d;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #3a4f41;
}

.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a4f41;
}

.attendance-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.attendance-filters select,
.attendance-filters input {
    flex: 1;
}

.attendance-filters button {
    margin-top: 5px;
    padding: 8px 15px;
    width: auto;
}

.attendance-summary {
    background: #2a3a2e;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-container {
    background: #333;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s;
}

.desa-card {
    background: #2a3a2e;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    border-left: 4px solid #4CAF50;
}

.desa-card.incomplete {
    border-left-color: #FF9800;
}

.desa-header {
    padding: 10px 15px;
    background: #3a4f41;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desa-name {
    font-weight: bold;
    color: #9fd49f;
    font-size: 16px;
}

.desa-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.desa-files {
    padding: 10px 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    padding: 8px 0;
    border-bottom: 1px solid #3a4f41;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-size: 14px;
    color: #f5f5f5;
}

.file-meta {
    font-size: 12px;
    color: #a5a5a5;
    margin-top: 3px;
}

.file-link {
    color: #b2d8b2;
    text-decoration: none;
    margin-left: 10px;
}

.attendance-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.attendance-actions button {
    flex: 1;
    margin-top: 0;
    padding: 10px;
}

/* Popup Terima Kasih */
.thankyou-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
}

.thankyou-content {
    background: linear-gradient(135deg, #1d1f1d, #2b4d2b);
    padding: 30px;
    border-radius: 15px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    border: 3px solid #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
    animation: scaleIn 0.5s ease;
}

/* Install Button */
#installButton {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 8px;
}

#installButton:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.fa-spin {
    animation: spin 1s infinite linear;
}

/* ================= JADWAL PIKET STYLE ================= */
#jadwalPiketContainer {
    display: none;
    background: black-translucent;
    color: black-translucent;
    padding: 10px;
    border-radius: 0px;
    margin-top: 20px;
}

.jadwal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid white;
}

.jadwal-title {
    color: gold;
    margin-bottom: 10px;
    font-size: 24px;
    text-align: center;
}

.jadwal-logo {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    border-radius: 8px;
    border: 2px;
    margin-bottom: 15px;
}

.jadwal-section {
    background: rgba(0, 60, 0, 0.7);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.jadwal-section h3 {
    margin: 10px 0;
    font-size: 16px;
    text-align: left;
}

.section-title-koramil {
    border: 1px solid #0088cc;
    color: #4dff4d;
}

.section-title-kediaman {
    border: 1px solid #0088cc;
    color: #ffcc00;
}

.section-title-makodim {
    border: 1px solid #0088cc;
    color: #00ccff;
}

.jadwal-btn {
    background: red;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
    border: 1px solid #4dff4d;
}

.jadwal-btn:hover {
    background: green;
}

.jadwal-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 80, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 80%;
    text-align: center;
}

.jadwal-toast.show {
    opacity: 1;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.col {
    flex: 1;
    min-width: 0;
}

.telegram-group-selector {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 80, 0, 0.5);
    border-radius: 5px;
    border-left: 3px solid #0088cc;
}

.telegram-group-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #00ccff;
}

.telegram-group-selector select {
    background-color: rgba(0, 40, 0, 0.8);
    color: #e6ffe6;
    border: 1px solid #0088cc;
}

.share-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.share-icons i {
    font-size: 24px;
}

.section-content {
    display: block;
}

@media screen and (min-width: 601px) {
    .section-content {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .section-content>div {
        flex: 1;
        min-width: 250px;
    }
}

.app-loading {
    text-align: center;
    padding: 10px;
    color: #4dff4d;
    display: none;
}

/* ================= JADWAL PIKET MESSAGE PREVIEW ================= */
#j_hasilPesan {
    width: 100%;
    min-height: 250px;
    max-height: 400px;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #0088cc;
    background-color: rgba(0, 40, 0, 0.9);
    color: #e6ffe6;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-top: 10px;
    white-space: pre-wrap;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#j_hasilPesan::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

#j_hasilPesan:focus {
    outline: none;
    border-color: #4dff4d;
    box-shadow: 0 0 10px rgba(77, 255, 77, 0.5);
}

/* ================= WHATSAPP & TELEGRAM BUTTON ================= */
.jadwal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 30px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    max-width: 350px;
    margin: 20px auto;
    background: linear-gradient(135deg, #8B0000 0%, #8B0000 50%, #E8E8E8 50%, #E8E8E8 100%);
    border: 2px solid #660000;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.2);
}

.icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 15px;
    position: relative;
}

.whatsapp-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.telegram-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0088cc, #0066aa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3);
}

.whatsapp-icon i,
.telegram-icon i {
    font-size: 30px;
    color: white;
}

.platform-name {
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 1px;
}

.platform-desc {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 720px) {
    #j_hasilPesan {
        min-height: 600px;
        max-height: 600px;
        font-size: 13px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .header-image {
        height: 120px;
        width: 120px;
    }

    .header-title {
        font-size: 15px;
    }

    .header-subtitle {
        font-size: 11px;
    }

    button {
        padding: 10px;
    }

    .attendance-filters {
        flex-direction: column;
    }

    .attendance-actions {
        flex-direction: column;
    }

}

/* Tablet Breakpoint */
@media (min-width: 600px) and (max-width: 1024px) {
    .splash-btn {
        padding: 18px 20px;
        min-height: 110px;
        gap: 10px;
    }

    .splash-btn i {
        font-size: 44px;
    }

    .splash-btn span {
        font-size: 15px;
    }

    .splash-buttons {
        max-width: 600px;
    }

    .splash-circle {
        width: 150px;
        height: 150px;
    }

    .splash-title {
        font-size: 28px;
    }

    .splash-progress-container {
        width: 250px;
    }

    .nav-buttons {
        flex-direction: column;
    }

    .nav-btn {
        padding: 10px;
    }

    .splash-buttons {
        flex-direction: column;
    }

    .splash-btn {
        padding: 15px 15px;
        min-height: 100px;
        gap: 8px;
    }

    .splash-btn i {
        font-size: 40px;
    }

    .splash-btn span {
        font-size: 14px;
    }

    .thankyou-content {
        padding: 20px;
        width: 95%;
    }

    .jadwal-btn {
        padding: 15px 20px;
        min-width: 220px;
    }

    .icon-container {
        gap: 20px;
    }

    .whatsapp-icon,
    .telegram-icon {
        width: 45px;
        height: 45px;
    }

    .whatsapp-icon i,
    .telegram-icon i {
        font-size: 22px;
    }
}