/* FILE: style.css */

/* Global Reset and Body */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1 {
    color: #333;
    border-bottom: 3px solid #f7931e;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Admin Nav Bar (Tombol Pindah Panel) */
.admin-nav-bar {
    margin: 20px 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    display: flex;
    gap: 10px;
}

.admin-nav-bar .btn {
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.admin-nav-bar .btn-primary {
    background-color: #007bff; /* Biru */
    color: white;
}

.admin-nav-bar .btn-secondary {
    background-color: #6c757d; /* Abu-abu */
    color: white;
}

.admin-nav-bar .btn-primary:hover,
.admin-nav-bar .btn-secondary:hover {
    opacity: 0.9;
}

/* Cards and Sections */
.card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.card h2 {
    color: #555;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.login-card {
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

/* Form Styling */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    color: #777;
    font-size: 0.9em;
}

.half-group {
    display: flex;
    gap: 20px;
}

.half-group > div {
    flex: 1;
}

/* Buttons */
button, .btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 5px;
    transition: background-color 0.3s;
}

.btn-primary, button[type="submit"] {
    background-color: #28a745; /* Hijau */
    color: white;
}

.btn-danger {
    background-color: #dc3545; /* Merah */
    color: white;
}

.btn-edit {
    background-color: #ffc107; /* Kuning */
    color: #333;
}

.btn-primary:hover, button[type="submit"]:hover {
    background-color: #218838;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
}

.logout-btn {
    background-color: #6c757d;
    color: white;
    float: right;
    margin-top: -50px;
}
.logout-btn:hover { background-color: #5a6268; }

/* Table Styling */
.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.menu-table th, .menu-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.menu-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Status Badge */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
}

.status-badge.active { background-color: #28a745; }
.status-badge.inactive { background-color: #ffc107; color: #333; }
.status-badge.expired { background-color: #dc3545; }

/* Toggle Switch (Sama seperti yang dibutuhkan di index.php) */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 25px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

.slider.round {
    border-radius: 25px;
}

.slider.round:before {
    border-radius: 50%;
}