/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.background-new {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-image: url('https://360.readymix.io/new_bg_downscaled.17a594e6f8e17c5b6eb9.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================
   LAYOUT & CONTAINER
   ============================================ */

.health-check-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.health-check-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

.health-check-card p {
    margin: 0.5rem 0;
}

/* ============================================
   TITLE & SUMMARY
   ============================================ */

.health-check-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-bottom: 2rem;
}

.health-check-logo {
    height: 6rem;
    width: auto;
}

.health-check-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #0000009e;
    margin: 0;
    text-align: center;
}

.health-check-summary {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #bdbdbd;
    border-radius: 8px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* font-weight: 400; */
    gap: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.summary-item.all-healthy {
    color: #28a745;
}

.summary-item.has-errors {
    color: #d95236;
}

.summary-item i {
    font-size: 1.5rem;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.health-check-error-message {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(217, 82, 54, 0.08);
    border: 1px solid #d95236;
    border-radius: 8px;
    color:#d95236
}

/* ============================================
   MAINTENANCE BANNER
   ============================================ */

.maintenance-banner {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #3e64ff14;
    border: 1px solid #3E64FF;
    border-radius: 8px;
    color: #3E64FF;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.maintenance-banner i {
    color: #3E64FF;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.maintenance-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.maintenance-banner p {
    margin: 0;
    color: #3E64FF;
    font-weight: bold;
}

.maintenance-schedule {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #3E64FF;
}

.schedule-item i {
    font-size: 1rem;
    color: #3E64FF;
}

.maintenance-countdown {
    font-size: 0.875rem;
}

.countdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #3E64FF;
}

.countdown-item i {
    font-size: 1rem;
    color: #3E64FF;
}

.maintenance-active {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #3e64ff14;
    border: 1px solid #3E64FF;
    border-radius: 8px;
    color: #3E64FF;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.maintenance-active i {
    color: #3E64FF;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.maintenance-active .maintenance-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.maintenance-active p {
    margin: 0;
    color: #3E64FF;
    font-weight: bold;
}

.maintenance-active .schedule-item {
    color: #3E64FF;
}

.maintenance-active .schedule-item i {
    color: #3E64FF;
    font-size: 1rem;
}

/* ============================================
   SECTIONS
   ============================================ */

.health-check-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.separator-line {
    height: 1px;
    opacity: 0.25;
    margin: 2rem 0;
}

/* ============================================
   HEALTH CHECK ITEMS
   ============================================ */

.health-check-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.health-check-item {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.health-check-item.checking {
    border-color: #6c757d;
    opacity: 0.7;
}

.health-check-item.healthy {
    border-color: #28a745;
    background: rgba(212, 237, 218, 0.3);
}

.health-check-item.unhealthy {
    border-color: #F48B08;
    color: #F48B08;
    background: rgba(244,139,8,0.08);
}

.health-check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.health-check-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.health-check-name i {
    font-size: 1.5rem;
}

.health-check-name i.mdi-check-circle {
    color: #28a745;
}

.health-check-name i.mdi-check-circle-outline {
    color: #28a745;
}

.health-check-name i.mdi-alert-circle-outline {
    color: #F48B08;
}

.health-check-name i.mdi-loading {
    color: #6c757d;
}

.status-badge {
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-badge.status-healthy {
    background: #28a745;
    color: white;
}

.status-badge.status-unhealthy {
    background: #ffc107;
    color: white;
}

.health-check-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.health-check-url {
    font-size: 0.875rem;
    color: #6c757d;
    word-break: break-all;
    font-family: monospace;
}

.health-check-metrics {
    display: flex;
    gap: 1rem;
}

.metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #000000cc;
}

.health-check-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f48a0a;
    font-size: 0.875rem;
    border-radius: 4px;
}

/* ============================================
   ACTIONS & CONTROLS
   ============================================ */

.health-check-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.health-check-actions button {
    padding: 0.5rem 1.4rem;
    background: #3E64FF;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    height: 36px;
    display: flex;
    align-items: center;
    /* gap: 0.5rem; */
    transition: background 0.3s
    ease;
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);
}

.health-check-actions button:hover:not(:disabled) {
    background: #0056b3;
}

.health-check-actions button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.health-check-actions button i {
    margin-right: 0.5rem;
}

/* ============================================
   TEST MENU
   ============================================ */

.test-menu {
    position: fixed;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.test-menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-btn-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.test-btn-error:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.test-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.test-btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.test-btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.test-btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.test-btn-danger {
    background: linear-gradient(135deg, #fd7e14 0%, #e86800 100%);
}

.test-btn-danger:hover {
    background: linear-gradient(135deg, #e86800 0%, #d45e00 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.3);
}

.test-btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.test-btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.test-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.test-btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.test-menu-btn:active {
    transform: scale(0.95);
}

.test-menu-btn i {
    font-size: 1.25rem;
}

.test-menu-btn::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}

.test-menu-btn::before {
    content: '';
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}

.test-menu-btn:hover::after,
.test-menu-btn:hover::before {
    opacity: 1;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.mdi-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .test-menu {
        left: 0.5rem;
        padding: 0.5rem;
    }

    .test-menu-btn {
        width: 36px;
        height: 36px;
    }

    .test-menu-btn i {
        font-size: 1.1rem;
    }

    .test-menu-btn::after {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .health-check-container {
        padding: 1rem;
    }

    .health-check-card {
        padding: 1.5rem;
    }


    .health-check-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .health-check-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .health-check-actions {
        display: none;
    }
}
