
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Roboto:wght@400;500&display=swap');

/* --- Reset & Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 1rem;
}

/* --- Header & Navigation --- */
header {
    background-color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav a.nav-link {
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    color: #3498db;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    border: 1px solid #3498db;
}

nav a.nav-link:hover, nav a.nav-link.active {
    background-color: #3498db;
    color: #ffffff;
}

/* --- Main Content & Layout --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
}

/* --- Card & Form Containers --- */
.card, .form-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.card h2, .form-container h2 {
    margin-top: 0;
    font-size: 1.8rem;
}

/* --- Forms & Inputs --- */
form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #dddddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* --- Buttons --- */
button, .button {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    background-color: #2ecc71;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover, .button:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

#google-register-btn, #google-login-btn {
    background-color: #4285F4;
    margin-top: 1rem;
}

#google-register-btn:hover, #google-login-btn:hover {
    background-color: #357ae8;
}

/* --- Result Area --- */
#result {
    margin-top: 2rem;
    text-align: left;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 700px; /* Lebar lebih besar untuk tabel hasil */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* --- Result Table & Loader --- */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.result-table td {
    padding: 0.85rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table td:first-child {
    width: 35%;
    font-weight: 500;
    color: #555;
}

/* Gaya untuk tabel bersarang */
.result-table .result-table {
    margin-top: 0;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

.result-table .result-table td {
    padding: 0.6rem;
}

.status-active {
    color: #27ae60;
    font-weight: bold;
}

.status-inactive {
    color: #e74c3c;
    font-weight: bold;
}

.not-available {
    color: #95a5a6;
    font-style: italic;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* --- History Page --- */
.history-list {
    width: 100%;
    max-width: 800px;
}

.history-item {
    text-align: left;
    margin-bottom: 1.5rem;
}

.history-item h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.history-item p {
    margin-bottom: 0.5rem;
}

.result-table-container h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

/* --- Footer --- */
.site-footer {
    background-color: #ffffff;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    width: 100%;
    margin-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.social-media-links {
    display: flex;
    gap: 1.5rem; /* Jarak antar ikon */
    margin-bottom: 1rem;
}

.social-media-links a {
    color: #555;
    transition: color 0.3s, transform 0.3s;
}

.social-media-links a:hover {
    color: #3498db;
    transform: scale(1.1);
}

.social-media-links svg {
    width: 28px;
    height: 28px;
}

.site-footer p {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    color: #777;
    font-size: 0.9rem;
}


/* --- Notification Toast --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 25px;
    border-radius: 50px;
    background-color: #333;
    color: white;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: #2ecc71; /* Green */
}

.toast.error {
    background-color: #e74c3c; /* Red */
}

.toast.info {
    background-color: #3498db; /* Blue */
}

/* --- Utility & Responsive --- */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
        text-align: center; /* Center align title */
    }

    header h1 {
        margin-bottom: 1rem;
        font-size: 1.5rem; /* Slightly smaller title on mobile */
    }

    nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap; /* Allow nav links to wrap */
        justify-content: center;
    }
    
    nav a.nav-link {
        padding: 0.5rem 0.8rem; /* Tighter padding on nav links */
        margin: 0.25rem; /* Add some margin for wrapping */
    }

    main {
        padding: 1rem;
        justify-content: flex-start; /* Align content to the top */
    }

    .card, .form-container {
        padding: 1.5rem; /* Reduce padding inside cards on mobile */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Softer shadow */
    }

    .card h2, .form-container h2 {
        font-size: 1.5rem; /* Smaller headings in cards */
    }

    #result {
        max-width: 100%;
        padding: 1rem;
    }

    /* Make result table cells stack for better readability */
    .result-table td {
        display: block;
        width: 100% !important; /* Override inline styles or other specifics */
        padding-left: 0;
        padding-right: 0;
        border-bottom: 1px solid #e9ecef;
    }

    .result-table tr td:first-child {
        font-weight: 600; /* Bolder key */
        background-color: #f8f9fa;
        padding-top: 0.75rem;
        padding-bottom: 0.25rem;
        border-top: 1px solid #e0e0e0;
    }
    
    .result-table tr:first-child td:first-child {
        border-top: none;
    }

    .result-table tr:last-child td {
        border-bottom: none;
    }
    
    .footer-content {
        flex-direction: column; /* Stack footer items on mobile */
    }

    .social-media-links {
        margin-bottom: 1.5rem;
    }
}
