/* static/css/style.css */
:root {
    --stark-red: #e1251b;
    --stark-yellow: #cdda3d;
    --stark-purple: #891c66;
    --stark-light-bg: #f5f5f5;
    --stark-text: #333;
    --stark-border: #ddd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--stark-text);
    background-color: var(--stark-light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--stark-border);
}

.logo img {
    height: 50px;
}

.header-title h1 {
    color: var(--stark-red);
    font-size: 24px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

/* Main Content */
main {
    margin-bottom: 40px;
}

/* Login Box */
.login-box {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-box h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--stark-red);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--stark-border);
    border-radius: 4px;
    font-size: 16px;
}

.form-actions {
    text-align: right;
    margin-top: 30px;
}

/* Status Panel */
.status-panel {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.status-panel h2 {
    margin-bottom: 15px;
    color: var(--stark-red);
}

.status-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.status-item {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--stark-yellow);
}

.status-label {
    font-weight: bold;
    margin-right: 10px;
}

/* CSS für die neue Ressourcen-Status-Anzeige */
.resource-status-textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    margin-top: 10px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid var(--stark-border);
    border-radius: 4px;
    background-color: #f9f9f9;
    color: var(--stark-text);
    white-space: pre;
    overflow-x: auto;
    resize: vertical;
    line-height: 1.5;
}

.resource-status-panel {
    margin-bottom: 30px;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-loading {
    color: #6c757d;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

#overall-status {
    border-left: 4px solid var(--stark-yellow);
}

#overall-status.status-running {
    border-left-color: #28a745;
}

#overall-status.status-stopped {
    border-left-color: #dc3545;
}

#overall-status.status-partial {
    border-left-color: #fd7e14;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-info:disabled {
    background-color: #6c757d;
}

/* CSS für die Ressourcen-Status-Anzeige */
.resource-status-textarea {
    width: 100%;
    height: 500px;
    padding: 15px;
    margin-top: 15px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid var(--stark-border);
    border-radius: 4px;
    background-color: #f9f9f9;
    color: var(--stark-text);
    white-space: pre;
    overflow-x: auto;
    resize: vertical;
    line-height: 1.5;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.action-buttons-container {
    display: flex;
    align-items: center;
}

/* Konsistente Abstände zwischen allen Panels */
.status-panel, .action-panels {
    margin-bottom: 30px; /* Gleicher Abstand für alle Panel-Container */
}

/* Spezieller Abstand für das letzte Panel */
#resource-status-panel {
    margin-top: 30px; /* Gleicher Abstand wie zu den anderen Panels */
}

/* Verbesserte Container für Status-Loading und Error-Messages */
.status-loading, .error-message {
    margin: 0;
    padding: 8px;
    height: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.status-loading.show, .error-message.show {
    max-height: 50px;
    margin: 10px 0;
    padding: 8px;
}

/* Countdown-Stil */
.refresh-countdown {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    color: #6c757d;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.refresh-countdown.hidden {
    display: none;
}

#countdown-timer {
    font-weight: bold;
    color: var(--stark-red);
}

/* Gesamtstatus-Farben */
.status-value {
    font-weight: bold;
}

.status-running {
    color: #28a745 !important; /* Grün für "RUNNING" */
}

.status-stopped {
    color: #dc3545 !important; /* Rot für "STOPPED" */
}

.status-partial {
    color: #fd7e14 !important; /* Orange für "PARTIAL" */
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-info:disabled {
    background-color: #6c757d;
}

/* Auto-Refresh aktiv */
.auto-refresh-active {
    background-color: #28a745 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Action Panels */
.action-panels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.action-panel {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.action-panel h2 {
    margin-bottom: 15px;
    color: var(--stark-red);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--stark-red);
    color: white;
}

.btn-primary:hover {
    background-color: #c11b12;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: var(--stark-purple);
    color: white;
}

.btn-warning:hover {
    background-color: #761c51;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Message Styles */
.error-message {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.warning-message {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
}

.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: opacity 0.3s;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--stark-border);
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .user-info {
        align-items: flex-start;
    }

    .action-panels {
        grid-template-columns: 1fr;
    }
}