/*
Theme Name: ServerControl
Description: Professional Server Management Dashboard
Version: 1.0
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid #0f3460;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(15, 52, 96, 0.3);
}

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

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #a0a8cc;
    font-size: 0.9rem;
}

.logout-btn, .login-btn {
    color: #00d4ff;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid #00d4ff;
    border-radius: 6px;
    transition: all 0.3s;
    background: rgba(0, 212, 255, 0.1);
}

.logout-btn:hover, .login-btn:hover {
    background: #00d4ff;
    color: #0a0a0a;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Main Dashboard */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Section */
.dashboard-section {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.6) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    opacity: 0.6;
}

.dashboard-section:hover {
    border-color: rgba(0, 212, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.section-header h2 {
    font-size: 1.3rem;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc, #00d4ff);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, #0080ff, #33ddff);
}

.btn-secondary {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.refresh-btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 102, 204, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: #00d4ff;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.refresh-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: rotate(180deg);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 102, 204, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    animation: pulse-tech 3s ease-in-out infinite;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.metric-label {
    font-size: 0.9rem;
    color: #a0a8cc;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    font-family: 'Courier New', monospace;
}

.metric-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00d4ff);
    transition: width 0.8s ease;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Container Grid */
.containers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.container-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(26, 26, 46, 0.6));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
    backdrop-filter: blur(15px);
}

.container-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.container-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
}

.container-status {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.container-details {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #a0a8cc;
}

.container-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 102, 204, 0.1));
    color: #00d4ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: inherit;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 102, 204, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
}

/* Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.health-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(26, 26, 46, 0.6));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(15px);
    transition: all 0.3s;
}

.health-service {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 0.5rem;
}

.health-url {
    font-size: 0.8rem;
    color: #a0a8cc;
    margin-bottom: 1rem;
    word-break: break-all;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.health-response {
    font-size: 0.85rem;
    color: #ccc;
}

/* Status Colors */
.status-running {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #000;
}

.status-stopped {
    background: linear-gradient(135deg, #ff4757, #cc3e47);
    color: #fff;
}

.status-online {
    background: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.status-offline {
    background: #ff4757;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.status-warning {
    background: #ffb347;
    box-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
}

/* Grafana Integration */
.grafana-section {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(26, 26, 46, 0.8));
    border-color: rgba(0, 102, 204, 0.3);
}

.grafana-controls {
    display: flex;
    gap: 0.5rem;
}

.grafana-container {
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.2);
}

.grafana-container iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: none;
}

/* Backups Table */
.backups-table {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    transition: all 0.3s;
}

.backup-item:hover {
    background: rgba(0, 212, 255, 0.08);
}

.backup-item:last-child {
    border-bottom: none;
}

.backup-info {
    flex: 1;
}

.backup-name {
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 0.3rem;
}

.backup-details {
    font-size: 0.9rem;
    color: #a0a8cc;
}

.backup-size {
    font-size: 0.9rem;
    color: #00d4ff;
    font-weight: 500;
    margin-right: 1rem;
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

.backup-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 0.85rem;
}

.backup-btn:hover {
    background: rgba(0, 212, 255, 0.2);
}

/* SSL Grid */
.ssl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.ssl-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(26, 26, 46, 0.6));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s;
    backdrop-filter: blur(15px);
}

.ssl-card.status-good {
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.ssl-card.status-warning {
    border-color: rgba(255, 179, 71, 0.4);
    box-shadow: 0 0 20px rgba(255, 179, 71, 0.1);
}

.ssl-card.status-critical {
    border-color: rgba(255, 71, 87, 0.4);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.1);
}

.ssl-domain {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 0.5rem;
}

.ssl-expiry {
    font-size: 0.9rem;
    color: #a0a8cc;
    margin-bottom: 0.3rem;
}

.ssl-days {
    font-size: 0.9rem;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.ssl-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-good {
    color: #00ff88;
}

.status-warning {
    color: #ffb347;
}

.status-critical {
    color: #ff4757;
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.actions-grid .action-btn {
    padding: 1rem;
    font-size: 0.95rem;
    height: auto;
    flex-direction: column;
    gap: 0.5rem;
}

/* Footer */
.dashboard-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1rem 2rem;
    border-top: 1px solid #0f3460;
    margin-top: auto;
    box-shadow: 0 -2px 20px rgba(15, 52, 96, 0.3);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    color: #a0a8cc;
    font-size: 0.9rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.separator {
    color: #0f3460;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top: 4px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.loading-text {
    color: #00d4ff;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 320px;
}

.notification {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #fff;
    backdrop-filter: blur(15px);
    transform: translateX(350px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.2);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-color: rgba(0, 255, 136, 0.4);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 204, 102, 0.05));
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.2);
}

.notification.error {
    border-color: rgba(255, 71, 87, 0.4);
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(204, 62, 71, 0.05));
    box-shadow: 0 8px 32px rgba(255, 71, 87, 0.2);
}

.notification.warning {
    border-color: rgba(255, 179, 71, 0.4);
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.1), rgba(245, 158, 11, 0.05));
    box-shadow: 0 8px 32px rgba(255, 179, 71, 0.2);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-close {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-message {
    font-size: 0.9rem;
    color: #ccc;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
    font-size: 1.1rem;
}

/* Tech Icons */
.icon-server::before { content: "🖥️"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-refresh::before { content: "🔄"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-cpu::before { content: "⚡"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-container::before { content: "📦"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-heart::before { content: "💙"; }
.icon-chart::before { content: "📊"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-backup::before { content: "💾"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-lock::before { content: "🔒"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-tools::before { content: "🔧"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-restart::before { content: "🔄"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-clean::before { content: "🧹"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-update::before { content: "⬆️"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-log::before { content: "📋"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-expand::before { content: "⤢"; filter: hue-rotate(200deg) brightness(1.2); }
.icon-external::before { content: "🔗"; filter: hue-rotate(200deg) brightness(1.2); }

/* Animations - Reduziert für bessere Performance */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-tech {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 15px rgba(0, 212, 255, 0.4); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sanftere Übergänge */
.dashboard-section {
    animation: fadeIn 0.3s ease-out;
}

/* Reduzierte Animationen */
.metric-card {
    animation: none; /* Pulse-Animation deaktiviert */
}

/* Optimierte Hover-Effekte */
.dashboard-section:hover {
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #0066cc);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #33ddff, #0080ff);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .dashboard-section {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .metrics-grid,
    .containers-grid,
    .health-grid,
    .ssl-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .notification-container {
        width: calc(100% - 20px);
        right: 10px;
    }
    
    .grafana-container iframe {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .backup-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .backup-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Focus states for accessibility */
.btn:focus,
.action-btn:focus,
.refresh-btn:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Print styles */
@media print {
    .dashboard-header,
    .dashboard-footer,
    .grafana-container,
    .action-btn,
    .refresh-btn {
        display: none;
    }
    
    .dashboard-section {
        page-break-inside: avoid;
        border: 1px solid #0f3460;
        margin-bottom: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dashboard-section {
        border-width: 2px;
    }
    
    .btn-primary {
        background: #0066cc;
        border: 2px solid #00d4ff;
    }
    
    .metric-value {
        font-weight: 900;
    }
}