* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 2em;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 0.9em;
    color: #666;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

.system-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.system-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.system-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.system-icon {
    font-size: 1.8em;
}

.system-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
}

.system-card-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Barra memoria */
.memory-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.memory-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #ffc107 75%, #dc3545 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
}

/* Display uptime */
.uptime-display {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.uptime-value {
    font-size: 1.5em;
    font-weight: 700;
}

/* Statistiche */
.system-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1em;
    color: #333;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.project-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-icon {
    font-size: 2em;
}

.project-name {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}

.project-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.project-status.online {
    background: #d4edda;
    color: #155724;
}

.project-status.offline {
    background: #f8d7da;
    color: #721c24;
}

.project-status.starting {
    background: #fff3cd;
    color: #856404;
}

.project-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
}

.project-info-item {
    display: flex;
    justify-content: space-between;
}

.project-info-label {
    color: #666;
    font-weight: 600;
}

.project-info-value {
    color: #333;
    font-family: 'Courier New', monospace;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-start {
    background: #28a745;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #218838;
}

.btn-stop {
    background: #dc3545;
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #c82333;
}

.btn-restart {
    background: #ffc107;
    color: #333;
}

.btn-restart:hover:not(:disabled) {
    background: #e0a800;
}

.btn-open {
    background: #007bff;
    color: white;
}

.btn-open:hover:not(:disabled) {
    background: #0056b3;
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-actions {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1 1 calc(50% - 5px);
    }
}

/* Animazione loading */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
