/* Tambahkan style untuk security notice */
.security-notice {
    background: #e3f2fd;
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.security-notice p {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #1976D2;
}

.security-notice ul {
    margin: 0;
    padding-left: 20px;
}

.security-notice li {
    margin: 5px 0;
    font-size: 12px;
    color: #555;
}

.current-text {
    font-size: 11px;
    color: #999;
    padding: 6px 12px;
    font-style: italic;
}

/* CSS yang sudah ada sebelumnya tetap dipertahankan */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    font-size: 13px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header dengan Logo */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 40px;
    width: auto;
    border-radius: 6px;
}

h1 {
    color: #333;
    font-size: 1.8em;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Login Header */
.login-header {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
}

.login-header .header-brand {
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 6px 12px;
    font-size: 11px;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-warning {
    background: #ff9800;
    color: white;
    padding: 6px 12px;
    font-size: 11px;
}

.btn-warning:hover {
    background: #e68900;
}

.btn-small {
    padding: 4px 8px;
    font-size: 10px;
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 15px;
    border-radius: 8px;
    gap: 12px;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
}

.search-box input:focus {
    outline: none;
    border-color: #2196F3;
}

.pagination-info {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    font-size: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-info {
    font-weight: 600;
    color: #333;
    padding: 0 8px;
    font-size: 12px;
}

/* Grid layout - MAX 6 KOLOM */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.host-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #4CAF50;
    display: flex;
    flex-direction: column;
}

.host-card.down {
    border-left-color: #f44336;
    background: #ffebee;
    order: -3;
}

.host-card.high {
    border-left-color: #ff9800;
    background: #fff8e1;
    order: -2;
}

.host-card.normal {
    border-left-color: #4CAF50;
    background: rgba(255, 255, 255, 0.95);
    order: -1;
}

.host-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.host-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.host-ip {
    color: #666;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-family: monospace;
}

.latency {
    font-size: 1.8em;
    font-weight: bold;
    margin: 6px 0;
    text-align: center;
}

.latency.normal {
    color: #4CAF50;
}

.latency.high {
    color: #ff9800;
}

.latency.down {
    color: #f44336;
}

.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
}

.status.normal {
    background: #e8f5e8;
    color: #4CAF50;
}

.status.high {
    background: #fff3e0;
    color: #ff9800;
}

.status.down {
    background: #ffebee;
    color: #f44336;
}

.threshold {
    color: #666;
    font-size: 0.75em;
    text-align: center;
    margin-top: 4px;
}

.timestamp {
    color: #888;
    font-size: 0.75em;
    margin-top: 6px;
    text-align: center;
}

.last-update {
    text-align: center;
    color: white;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.notification-badge {
    background: #ff4444;
    color: white;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: bold;
}

.loading {
    text-align: center;
    color: white;
    font-size: 1em;
    grid-column: 1 / -1;
    padding: 30px;
}

/* Hosts Management */
.hosts-management {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.add-host-form {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.hosts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.hosts-header h3 {
    margin: 0;
}

.hosts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 15px;
    border-radius: 8px;
    gap: 12px;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 12px;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    max-width: 350px;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    transition: border-color 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #4CAF50;
}

small {
    display: block;
    color: #666;
    font-size: 0.75em;
    margin-top: 4px;
}

/* Inline Forms untuk User Management */
.inline-form {
    display: inline-block;
    margin-right: 8px;
}

.form-inline {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-input {
    width: 120px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
}

.inline-select {
    width: 100px !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
}

/* Item Lists */
.host-item, .user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #2196F3;
}

.host-info, .user-info {
    flex: 1;
}

.host-details, .user-details {
    margin-bottom: 4px;
}

.host-threshold {
    color: #666;
    font-size: 0.85em;
}

.user-role {
    color: #666;
    font-size: 0.9em;
}

.host-actions, .user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.empty-hosts {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* User List */
.users-list {
    margin-top: 15px;
}

.user-status {
    margin-top: 4px;
}

.default-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #ff9800;
    color: white;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: bold;
}

.current-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #4CAF50;
    color: white;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: bold;
}

.custom-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #2196F3;
    color: white;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: bold;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.close {
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-content form {
    padding: 15px;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Config Styles */
.config-management {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.config-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.telegram-test {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.telegram-test h4 {
    margin-bottom: 10px;
    color: #333;
}

.telegram-test p {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
}

.status-message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
    font-size: 12px;
}

.status-message.success {
    background: #e8f5e8;
    color: #4CAF50;
    display: block;
}

.status-message.error {
    background: #ffebee;
    color: #f44336;
    display: block;
}

/* Login Page */
.login-container {
    max-width: 500px;
}

.login-header {
    margin-bottom: 0;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    text-align: center;
}

.login-box h3 {
    margin-bottom: 20px;
    color: #333;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.login-info p {
    margin: 5px 0;
    font-size: 12px;
}

.login-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    body {
        padding: 10px;
        font-size: 12px;
    }

    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px;
    }

    .header-brand {
        flex-direction: column;
        gap: 10px;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        padding: 10px;
    }

    .controls, .hosts-controls {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .hosts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .host-item, .user-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .host-actions, .user-actions {
        width: 100%;
        justify-content: center;
        flex-direction: column;
    }

    .form-inline {
        flex-direction: column;
        width: 100%;
    }

    .inline-input, .inline-select {
        width: 100% !important;
    }

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

    h1 {
        font-size: 1.5em;
    }

    .host-card {
        padding: 12px;
    }

    .latency {
        font-size: 1.6em;
    }
}

@media (max-width: 480px) {
    .user-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .logo {
        height: 32px;
    }
}
