body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    min-height: 100vh;
}
.container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 2rem auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.view-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
}
h1 {
    margin-top: 0;
    color: #2c3e50;
    text-align: center;
}
.form-group {
    margin-bottom: 1.5rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #2980b9;
}
/* Anchor variant of primary blue button (used for pagination in history view) */
.page-button {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-weight: 500;
}
.page-button:hover {
    background-color: #2980b9;
}
.page-button.disabled {
    opacity: 0.6;
    pointer-events: none;
}
.error {
    color: #e74c3c;
    margin-top: 1rem;
    text-align: center;
}

.success {
    color: #2ecc71;
    margin-top: 1rem;
    text-align: center;
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.header h1 {
    color: #3498db;
    margin: 0;
    text-align: left;
}

.header h1 a {
    color: #3498db;
    text-decoration: none;
}

.app-version {
    font-size: 0.7em;
    color: #aaa;
    margin-top: 2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info p {
    margin: 0;
    font-weight: 500;
}

.logout-button {
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #c0392b;
}

.dashboard-content {
    margin-top: 2rem;
}

.monitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.add-monitor-button {
    display: inline-block;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.add-monitor-button:hover {
    background-color: #27ae60;
}

.add-button {
    background-color: #2ecc71;
    width: auto;
}

.add-button:hover {
    background-color: #27ae60;
}

.cancel-button {
    display: inline-block;
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.cancel-button:hover {
    background-color: #7f8c8d;
}

.no-monitors {
    color: #7f8c8d;
    font-style: italic;
}

.monitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.monitor-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.monitor-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Make the inner link look like plain text within the tile */
.monitor-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.monitor-info {
    margin-bottom: 1.5rem;
}

.monitor-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.monitor-uuid {
    margin: 0;
    font-size: 0.8rem;
    color: #7f8c8d;
    word-break: break-all;
}

/* Style the gap between history entries similar to the UUID label: small, grey */
.history-gap {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.monitor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.delete-button {
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.delete-button:hover {
    background-color: #c0392b;
}

.monitor-last-ping {
    margin: 0.5rem 0 0 0;
    color: #555;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ccc;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 1rem;
    }

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

    .add-monitor-form {
        width: 100%;
    }

    .add-monitor-form input {
        flex-grow: 1;
    }
}
