/*=====================================================================
  Table of Contents:
  1.  Fonts & Variables
  2.  Base Styles & General Layout
  3.  Header & Navigation
  4.  Card Components
  5.  Button Styles
  6.  Table (DataTables) Styles
  7.  Form & Input Styles
  8.  Alerts & Messages
  9.  Footer
  10. Responsive Adjustments (Media Queries)
=======================================================================*/


/*====================================
  1. Fonts & Variables
====================================*/
/* Import font dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Poppins:wght@400;600;700&display=swap');

:root {
    /* Definisi variabel warna untuk konsistensi */
    --primary-color: #4CAF50; /* Hijau yang lebih cerah untuk aksi positif */
    --primary-dark: #388E3C;
    --secondary-color: #6A0DAD; /* Ungu (Deep Purple) - Warna utama Anda sekarang */
    --secondary-dark: #4A0082; /* Untuk hover atau border gelap dari ungu */
    --danger-color: #dc3545; /* Merah Bootstrap default */
    --bg-light: #f8f9fa; /* Latar belakang terang */
    --bg-dark: #343a40; /* Latar belakang gelap */
    --text-dark: #343a40; /* Teks gelap */
    --text-light: #ffffff; /* Teks terang */
    --card-bg: #ffffff; /* Latar belakang card */
    --border-color: #e0e0e0; /* Warna border halus */
    --shadow-light: 0 4px 8px rgba(0, 0, 0, 0.08); /* Bayangan ringan */
    --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.15); /* Bayangan sedang */
}


/*====================================
  2. Base Styles & General Layout
====================================*/
body {
    font-family: 'Lato', sans-serif;
    **background: linear-gradient(to right bottom, #e0f2f7, #c6e8f4); /* Latar belakang gradasi biru muda cerah */**
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Gaya khusus untuk halaman login agar kontennya terpusat */
body.login-page,
body.registration-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-y: auto;
}

.container {
    padding-top: 40px;
    padding-bottom: 40px;
}

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/*====================================
  3. Header & Navigation (Tambahkan jika Anda punya navigasi atau header terpisah)
====================================*/


/*====================================
  4. Card Components
====================================*/
.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-bottom: 1px solid var(--primary-dark);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header .card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-light);
}

.card-body {
    padding: 2rem;
}


/*====================================
  5. Button Styles
====================================*/
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0.75rem 1.25rem;
    outline: none;
    box-shadow: none;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(106, 13, 173, 0.25); /* Efek bayangan ungu */
}

.btn-primary {
    background-color: var(--secondary-color); /* Menggunakan warna ungu */
    border-color: var(--secondary-color);
}
.btn-primary:hover {
    background-color: var(--secondary-dark); /* Menggunakan warna ungu gelap */
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-success:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}


/*====================================
  6. Table (DataTables) Styles
====================================*/
.table {
    margin-top: 20px;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th,
.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
}

.table thead th {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f0f0f0;
    transition: background-color 0.2s ease-in-out;
}

/* Penyesuaian Lebar Kolom DataTables */
#mytable th:nth-child(1), #mytable td:nth-child(1) { width: 40px; text-align: center; } /* No */
#mytable th:nth-child(2), #mytable td:nth-child(2) { width: 18%; } /* Nama Lengkap */
#mytable th:nth-child(3), #mytable td:nth-child(3) { width: 12%; } /* Tanggal Lahir */
#mytable th:nth-child(4), #mytable td:nth-child(4) { width: 15%; } /* No Whatsapp */
#mytable th:nth-child(5), #mytable td:nth-child(5) { width: 10%; } /* Pengirim */
#mytable th:nth-child(6), #mytable td:nth-child(6) { width: 20%; } /* Alamat */
#mytable th:nth-child(7), #mytable td:nth-child(7) { width: 10%; } /* Username */
#mytable th:nth-child(8), #mytable td:nth-child(8) { width: 70px; text-align: center; } /* Password */
#mytable th:nth-child(9), #mytable td:nth-child(9) { width: 140px; text-align: center; } /* Aksi */

/* Mengatasi styling DataTables default */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-dark) !important;
    color: var(--text-light) !important;
    box-shadow: var(--shadow-light);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: var(--text-dark) !important;
}

/* Styling untuk search input dan length select */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-dark);
}


/*====================================
  7. Form & Input Styles
====================================*/
.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus {
    border-color: var(--secondary-color); /* Border warna ungu saat fokus */
    box-shadow: 0 0 0 0.2rem rgba(106, 13, 173, 0.25); /* Efek bayangan ungu saat fokus */
    outline: none;
}

/* --- Gaya Khusus untuk Login Card --- */
.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    padding: 2.5rem;
    margin-top: 50px;
    margin-bottom: 50px;
    max-width: 420px;
    width: 100%;
}

.login-card .card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.75rem;
}

.login-card .btn-primary {
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

/* --- Gaya Khusus untuk Registration Page (Daftar) --- */
.registration-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    padding: 2.5rem;
    margin-top: 40px;
    margin-bottom: 40px;
    max-width: 600px;
    width: 100%;
}

.registration-card .card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.75rem;
}

.registration-card .btn-primary {
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 1.1rem;
    border-radius: 8px;
}


/*====================================
  8. Alerts & Messages (khusus untuk akses ditolak)
====================================*/
.access-denied-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 60px;
    margin-bottom: 60px;
}

.access-denied-card img {
    max-width: 250px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1));
}

.access-denied-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.access-denied-card p.lead {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.access-denied-card .btn-lg {
    padding: 0.9rem 2.5rem;
    font-size: 1.25rem;
    border-radius: 50px;
    box-shadow: var(--shadow-light);
}


/*====================================
  9. Footer (Tambahkan jika Anda punya footer terpisah)
====================================*/


/*====================================
  10. Responsive Adjustments (Media Queries)
====================================*/

/* Medium devices (tablets, 992px and up) */
@media (max-width: 992px) {
    .card-body {
        padding: 1.5rem;
    }
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .welcome-section {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .welcome-section .btn {
        margin-top: 10px;
    }
}

/* Small devices (landscape phones, 768px and up) */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    .card {
        border-radius: 8px;
    }
    .card-header {
        padding: 1rem;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }
    .card-title {
        font-size: 1.25rem;
    }
    .card-body {
        padding: 1rem;
    }
    .table th,
    .table td {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    .access-denied-card {
        padding: 2rem 1rem;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    .access-denied-card h3 {
        font-size: 1.5rem;
    }
    .access-denied-card p.lead {
        font-size: 1rem;
    }
    .access-denied-card .btn-lg {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }

    /* Responsive untuk Login Card pada tablet */
    .login-card {
        padding: 2rem;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    .login-card .card-title {
        font-size: 1.5rem;
    }
    .form-control {
        padding: 0.65rem 0.9rem;
        font-size: 0.95rem;
    }
    .login-card .btn-primary {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Responsive untuk Registration Card pada tablet */
    .registration-card {
        padding: 2rem;
        margin-top: 25px;
        margin-bottom: 25px;
    }
    .registration-card .card-title {
        font-size: 1.5rem;
    }
    .registration-card .btn-primary {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 576px) {
    /* Untuk tampilan HP sangat kecil, beberapa kolom bisa disembunyikan */
    #mytable th:nth-child(5), #mytable td:nth-child(5), /* Pengirim */
    #mytable th:nth-child(6), #mytable td:nth-child(6), /* Alamat */
    #mytable th:nth-child(7), #mytable td:nth-child(7) { /* Username */
         display: none;
    }

    #mytable th:nth-child(2), #mytable td:nth-child(2) { width: 25%; } /* Nama Lengkap lebih lebar */
    #mytable th:nth-child(3), #mytable td:nth-child(3) { width: 18%; } /* Tanggal Lahir lebih lebar */
    #mytable th:nth-child(4), #mytable td:nth-child(4) { width: 22%; } /* No Whatsapp lebih lebar */
    #mytable th:nth-child(8), #mytable td:nth-child(8) { width: 80px; } /* Password tetap */
    #mytable th:nth-child(9), #mytable td:nth-child(9) { width: 110px; } /* Aksi disesuaikan */

    .btn-sm {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    .btn-group-sm > .btn, .btn-sm {
        padding: .25rem .5rem !important;
        font-size: .875rem !important;
        line-height: 1.5 !important;
        border-radius: .2rem !important;
    }

    /* Responsive untuk Login Card pada ponsel */
    .login-card {
        padding: 1.5rem;
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 8px;
        box-shadow: var(--shadow-light);
    }
    .login-card .card-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    .form-control {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    .login-card .btn-primary {
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
    }

    /* Responsive untuk Registration Card pada ponsel */
    .registration-card {
        padding: 1.5rem;
        margin-top: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: var(--shadow-light);
    }
    .registration-card .card-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    .registration-card .btn-primary {
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
    }
}