:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
}

/* Navbar */
.navbar {
    border-bottom: 3px solid var(--primary-color);
}

/* Stack Cards */
.stack-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.stack-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stack-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stack-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.stack-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.stack-body {
    padding: 1.5rem;
}

/* Service Table */
.service-table {
    width: 100%;
    margin-bottom: 0;
}

.service-table thead {
    background-color: #f8f9fa;
}

.service-table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #6c757d;
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

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

.service-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.service-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.service-url a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.service-url a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.service-url .text-muted {
    font-style: italic;
}

.service-ip,
.service-port {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #495057;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-badge.status-up {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-badge.status-down {
    background-color: #f8d7da;
    color: #842029;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-indicator.up {
    background-color: var(--success-color);
}

.status-indicator.down {
    background-color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Loading Animation */
#loading {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Refresh Button Animation */
#refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

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

/* Summary Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-body h2 {
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 3px solid var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stack-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .service-table {
        font-size: 0.875rem;
    }
    
    .service-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .service-name {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Tooltip */
[data-bs-toggle="tooltip"] {
    cursor: help;
}

/* Network Badge */
.network-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}
