/* Coder Gateway Custom Styles */

/* ===== Header 吸顶效果 ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #212529; /* 与 navbar-dark bg-dark 一致 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Overall Layout */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    padding-top: 56px;  /* Header 高度，防止内容被遮挡 */
    margin-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 主容器样式 - 替代原来的 mt-4 */
.container-fluid {
    padding-top: 0;
}

/* Footer Styles */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
}

.nav-link i {
    margin-right: 0.25rem;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Status Badges */
.badge-healthy {
    background-color: #28a745;
}

.badge-unhealthy {
    background-color: #dc3545;
}

.badge-unknown {
    background-color: #6c757d;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-group .btn {
    margin-left: 0.25rem;
}

.btn-group .btn:first-child {
    margin-left: 0;
}

/* Forms */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: #007bff;
    margin-bottom: 1rem;
}

/* Health Status Indicators */
.health-status {
    display: inline-flex;
    align-items: center;
}

.health-status i {
    margin-right: 0.25rem;
}

.health-status.healthy {
    color: #28a745;
}

.health-status.unhealthy {
    color: #dc3545;
}

.health-status.unknown {
    color: #6c757d;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Alert Messages */
.alert {
    border-radius: 0.375rem;
}

/* Page Headers */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-header .page-description {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        font-size: 2rem;
    }
}

/* 移动端菜单展开时的样式优化 */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #212529;
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

/* Code Blocks */
code {
    padding: 0.2rem 0.4rem;
    font-size: 87.5%;
    color: #e83e8c;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

pre {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    overflow-x: auto;
}

pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}

/* Permission Management Styles */
.permission-groups {
    max-height: 500px;
    overflow-y: auto;
}

.permission-groups .card {
    margin-bottom: 0.75rem;
}

.permission-groups .card-header {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.permission-groups .card-body {
    padding: 1rem;
}

.permission-groups .form-check {
    margin-bottom: 0.5rem;
}

.permission-groups .form-check-label {
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.permission-groups .form-check-input {
    cursor: pointer;
}

.permission-groups .form-check-input:disabled {
    cursor: not-allowed;
}

.permission-groups .form-check-input:disabled ~ .form-check-label {
    cursor: not-allowed;
    opacity: 0.6;
}

.endpoint-checkbox {
    width: 1.2em;
    height: 1.2em;
}
