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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.auth-controls {
    position: absolute;
    top: 0;
    right: 0;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #c0392b;
    text-decoration: none;
    transform: translateY(-1px);
}

.logo {
    max-height: 80px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 0;
}

/* Main content */
.main-content {
    flex: 1;
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Force all service cards to fit in one row */
.service-card {
    min-width: 0; /* Allow cards to shrink */
    width: 100%;
}

/* Service cards */
.service-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 25px 20px 15px;
    text-align: center;
    position: relative;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 0 20px 20px;
    text-align: center;
}

.card-body p {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #6c757d;
}

.stat i {
    font-size: 0.9rem;
}

.card-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Service-specific colors */
.grafana .card-icon { color: #ff8c00; }
.btn-grafana { 
    background: linear-gradient(45deg, #ff8c00, #ff6b00);
}
.btn-grafana:hover { 
    background: linear-gradient(45deg, #ff6b00, #ff4500);
}

.homer .card-icon { color: #4285f4; }
.btn-homer { 
    background: linear-gradient(45deg, #4285f4, #1976d2);
}
.btn-homer:hover { 
    background: linear-gradient(45deg, #1976d2, #1565c0);
}

.management .card-icon { color: #28a745; }
.btn-management { 
    background: linear-gradient(45deg, #28a745, #20c997);
}
.btn-management:hover { 
    background: linear-gradient(45deg, #20c997, #17a2b8);
}

.monitoring .card-icon { color: #dc3545; }
.btn-monitoring { 
    background: linear-gradient(45deg, #dc3545, #c82333);
}
.btn-monitoring:hover { 
    background: linear-gradient(45deg, #c82333, #bd2130);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

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

.server-info {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Responsive design */
/* Large screens - force 4 columns */
@media (min-width: 1201px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 1400px;
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .logo {
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}