/* Modern Blue & White Design */

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

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

/* Smooth animated gradient with two colors */
@keyframes smoothGradient {
    0% {
        background-position: 0% 0%, 100% 100%;
    }
    25% {
        background-position: 100% 0%, 0% 100%;
    }
    50% {
        background-position: 100% 100%, 0% 0%;
    }
    75% {
        background-position: 0% 100%, 100% 0%;
    }
    100% {
        background-position: 0% 0%, 100% 100%;
    }
}

header {
    background: 
        linear-gradient(135deg, #1a6aff 0%, #00008b 100%),
        linear-gradient(-135deg, #00008b 0%, #1a6aff 100%);
    background-size: 200% 200%, 200% 200%;
    animation: smoothGradient 8s ease-in-out infinite;
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner {
    position: relative;
    z-index: 1;
    text-align: right;
}

.header-widgets {
    display: flex;
    gap: 15px;
    flex-direction: row;
    z-index: 1;
    /* Change flex-start to stretch to make boxes equal height */
    align-items: stretch; 
    justify-content: flex-start;
}

.widget {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px 25px;
    backdrop-filter: blur(10px);
    min-width: 155px;
    text-align: center;

    /* Use flexbox to control internal spacing */
    display: flex;
    flex-direction: column;
}

.widget-label {
    font-size: 0.8rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px; /* Fixed spacing below the title */
}

/* Use this version if you want the weather info stacked vertically every time */
.widget-value {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px; 
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.gradient-bg {
    display: none;
}

.header-content {
    display: none;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1rem;
    opacity: 0.95;
}

footer {
    background: #f5f5f5;
    color: #666;
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
}

footer p {
    font-size: 0.9rem;
    margin: 5px 0;
}

footer a {
    color: #1a6aff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #00008b;
    text-decoration: underline;
}

.container {
    width: 100%;
    flex: 1;
    padding: 20px;
}

#dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 50px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a6aff;
}

.category-icon {
    font-size: 2rem;
}

.category-title {
    font-size: 1.5rem;
    color: #00008b;
    font-weight: 600;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.service-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.service-card:hover {
    box-shadow: 0 6px 16px rgba(26, 106, 255, 0.2);
    transform: translateY(-4px);
    border-color: #1a6aff;
}

.service-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00008b;
    margin-bottom: 8px;
}

.service-card-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    flex-grow: 1;
}

.service-card::after {
    content: "→";
    font-size: 1.2rem;
    color: #1a6aff;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::after {
    opacity: 1;
}

.service-status {
    position: absolute;
    top: 10px;
    right: 10px;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.operational {
    background-color: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.status-dot.degraded {
    background-color: #FF9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.6);
}

.status-dot.unknown {
    background-color: #9E9E9E;
}

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

.status-dot.loading {
    background-color: #2196F3;
    animation: pulse 1.5s ease-in-out infinite;
}

.service-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
}

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

    header p {
        font-size: 0.9rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .category-title {
        font-size: 1.2rem;
    }

    .service-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 15px;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .category-section {
        margin-bottom: 30px;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error-message {
    background: #ffe6e6;
    border: 1px solid #ffb3b3;
    border-radius: 8px;
    padding: 20px;
    color: #c00;
    margin: 20px 0;
    text-align: center;
}
