/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-group button:hover {
    background: #5a67d8;
}

.error {
    background: #fee;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Dashboard styles */
.header {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.header p {
    color: #718096;
    margin-top: 0.25rem;
}

.user-info {
    color: #718096;
    font-size: 0.9rem;
}

.logout-btn {
    color: #e53e3e;
    text-decoration: none;
    font-weight: 500;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* View toggle */
.view-toggle {
    margin-bottom: 1.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: inline-flex;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-toggle button.active {
    background: #667eea;
    color: white;
}

.view-toggle button:hover:not(.active) {
    background: #f7fafc;
}

/* Search controls */
.search-controls {
    background: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-controls input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.search-controls input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.search-controls select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    min-width: 150px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: #f7fafc;
}

tr:last-child td {
    border-bottom: none;
}

/* Version summary styles */
.version-uniform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-badge {
    background: #48bb78;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.service-count {
    color: #718096;
    font-size: 0.8rem;
}

.version-mixed {
    max-width: 250px;
}

.version-item {
    display: flex;
    justify-content: space-between;
    padding: 0.1rem 0;
    font-size: 0.85rem;
}

.service-name {
    font-weight: 600;
    color: #2d3748;
}

.service-version {
    color: #718096;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.version-mixed-badge {
    background: #ed8936;
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

/* Utility styles */
.loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-data {
    color: #a0aec0;
    font-style: italic;
}

.timestamp {
    font-size: 0.85rem;
    color: #718096;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.history-table {
    display: none;
}

.back-btn {
    margin-bottom: 1rem;
}

.back-btn button {
    padding: 0.5rem 1rem;
    background: #718096;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.back-btn button:hover {
    background: #4a5568;
}

/* Action buttons */
.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #667eea;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .version-mixed {
        max-width: 150px;
    }
}
