/* Bootstrap Integration and Custom Styles */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Custom Header */
.custom-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-header h1 {
    font-weight: 300;
    font-size: 2.5rem;
    margin: 0;
}

/* Custom Navigation */
.custom-nav {
    background-color: #343a40;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.custom-nav .navbar-nav .nav-link {
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.custom-nav .navbar-nav .nav-link:hover,
.custom-nav .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

/* Profile Container */
.profile-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.profile-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-right: 2rem;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.profile-info h2 {
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 400;
}

.profile-info p {
    color: #666;
    margin-bottom: 0.25rem;
}

/* Navbar Toggler Icon Fix */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Endpoint Cards */
.endpoint-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.endpoint-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.endpoint-header {
    padding: 1.25rem;
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.endpoint-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

.endpoint-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--danger-color);
}

.endpoint-details {
    padding: 1.25rem;
}

.endpoint-actions {
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.type-ping {
    background-color: var(--info-color);
}

.type-post {
    background-color: #fd7e14;
}

.type-get {
    background-color: var(--success-color);
}

/* Stats Cards */

/* 50% smaller stat-cards */
.stats-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 0.75rem;
    text-align: center;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.stats-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stat-value, .stat-number.display-6.fw-bold {
    font-size: 1.25rem !important;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.4375rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uptime-good {
    color: var(--success-color);
}

.uptime-warning {
    color: var(--warning-color);
}

.uptime-danger {
    color: var(--danger-color);
}

/* Form Styling */
.form-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 2rem;
    margin-bottom: 2rem;
}

.color-preview {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

/* Table Styling */
.log-table {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.log-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.status-up {
    color: var(--success-color);
    font-weight: 600;
}

.status-down {
    color: var(--danger-color);
    font-weight: 600;
}

/* Time Filter */
.time-filter {
    margin: 1.5rem 0;
    text-align: center;
}

.time-filter .btn {
    margin: 0 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-header h1 {
        font-size: 2rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-logo {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .endpoint-actions {
        text-align: center;
    }

    .endpoint-actions .btn {
        margin: 0.25rem;
        width: auto;
    }
}

@media (max-width: 576px) {
    .custom-header {
        padding: 1rem 0;
    }

    .custom-header h1 {
        font-size: 1.75rem;
    }

    .stats-card {
        margin-bottom: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Utility Classes */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Custom button styles */
.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Custom Navbar Styles */
.custom-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-navbar .navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.custom-navbar .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

/* Gradient Header */
.gradient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-header h1 {
    font-weight: 300;
    font-size: 2.5rem;
    margin: 0;
}

/* Statistics Icons */
.stat-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
    font-weight: 600;
}

/* Admin Users Table Enhancements */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

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

/* Badge Enhancements */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge i {
    font-size: 0.7rem;
}

/* Button Group Improvements */
.btn-group-sm>.btn,
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Custom Footer */
.custom-footer {
    background-color: #343a40;
    color: #ffffff;
    padding: 2rem 0;
    margin-top: auto;
}

.custom-footer h5 {
    color: #ffffff;
    font-weight: 500;
}

.custom-footer .text-muted {
    color: #adb5bd !important;
}

/* Ensure body takes full height */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

/* Admin Users Table Styles */
.users-table {
    width: 100%;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.users-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.users-table th {
    padding: 1rem;
    font-weight: 500;
    text-align: left;
    border: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Role and Status Badges */
.role-admin {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-user {
    background-color: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-inactive {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Button Styles for Actions */
.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    margin: 0 0.125rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-small.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-small.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-small.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-small.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-small:not(.btn-success):not(.btn-danger) {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-small:not(.btn-success):not(.btn-danger):hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* Responsive Table */
@media (max-width: 768px) {
    .users-table {
        font-size: 0.875rem;
    }

    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }

    .users-table th {
        font-size: 0.75rem;
    }

    .btn-small {
        padding: 0.125rem 0.5rem;
        font-size: 0.6875rem;
        margin: 0.125rem;
        display: block;
        width: 100%;
        text-align: center;
    }
}