/*
 * File: style.css
 * Styling modern dan mobile friendly untuk VMS
 */

/* Variabel Warna Dasar */
:root {
    --primary-color: #007bff; /* Biru Primer */
    --secondary-color: #6c757d; /* Abu-abu Sekunder */
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --bg-light: #f4f6f9; /* Latar belakang terang dan bersih */
    --text-dark: #343a40; /* Teks gelap */
    --border-color: #e9ecef;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Shadow halus */
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Reset dan Tipografi Dasar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* --------------------
   GLOBAL ELEMENTS & CONTAINERS
   -------------------- */

.main-content {
    padding: 30px 20px;
    min-height: 85vh;
}

.form-container, .reports-container, .user-management-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0; /* Padding sudah ada di main-content */
}

/* Base Card Styling - Digunakan untuk Form, List, dan Section */
.card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
}

.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    border: 1px solid transparent;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* --------------------
   BUTTONS & FORMS
   -------------------- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.1s;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-primary, .btn-submit { background-color: var(--primary-color); color: white; }
.btn-primary:hover, .btn-submit:hover { background-color: #0056b3; }
.btn-success { background-color: var(--success-color); color: white; }
.btn-danger { background-color: var(--error-color); color: white; }
.btn-info { background-color: #17a2b8; color: white; }
.btn i { margin-right: 8px; }


/* --------------------
   LOGIN LAYOUT
   -------------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--primary-color);
}
.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.logo { max-width: 100px; margin-bottom: 20px; }
.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.input-icon {
    padding: 10px 12px;
    background-color: #f8f9fa;
    color: var(--secondary-color);
    border-right: 1px solid var(--border-color);
}
input[type="text"], input[type="password"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
}


/* --------------------
   DASHBOARD CARDS (stat-card)
   -------------------- */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 5px solid;
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
}
.stat-card h3 {
    color: #555;
    font-size: 1rem;
    margin-bottom: 10px;
}
.stat-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
}
.stat-card p {
    font-size: 0.9rem;
    color: #999;
    margin-top: 5px;
}

/* --------------------
   TABLES & LISTS
   -------------------- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-dark);
}
tr:last-child td {
    border-bottom: none;
}
.pending-table th {
    background-color: var(--warning-color);
    color: var(--text-dark);
}
.visitor-photo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* --------------------
   RESPONSIVENESS (Mobile)
   -------------------- */

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav ul {
        flex-wrap: wrap;
        padding-top: 10px;
    }
    .main-nav li {
        margin: 5px 10px 5px 0;
    }
    .main-content {
        padding: 20px 10px;
    }
    .card-container {
        grid-template-columns: 1fr;
    }
    
    /* Responsive Table Hiding */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding-top: 10px;
    }
    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
        font-size: 0.95rem;
    }
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }
}
