/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    line-height: 1.6;
}

.container, .login-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #2b2b2b; /* Slightly lighter dark background for content */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-container {
    max-width: 400px;
}

h1, h2 {
    color: #ffffff;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

a {
    color: #4CAF50; /* Green links */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header Navigation */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.header h1 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.header nav {
    margin-top: 10px; /* Add some space when wrapped */
}

.header nav a {
    margin-left: 15px;
}

/* Buttons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Responsive grid */
    gap: 15px; /* Space between buttons */
    margin-top: 20px;
}

.button {
    padding: 12px 20px;
    font-size: 1em; /* Relative font size */
    cursor: pointer;
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-decoration: none; /* For <a> tags styled as buttons */
    display: inline-block; /* Proper alignment and sizing */
    text-align: center;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    width: 100%; /* Make buttons fill grid cells */
}

.button:hover {
    background-color: #45a049; /* Darker green on hover */
}

/* Forms (Login) */
.login-container form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.login-container form input[type=text],
.login-container form input[type=password] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #555;
    background-color: #333;
    color: #e0e0e0;
    box-sizing: border-box;
    border-radius: 4px;
}

/* Messages (Flash) */
.messages {
    margin: 15px 0;
}

.message.flash {
    padding: 10px 15px;
    border-radius: 4px;
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #fff;
    margin-bottom: 10px;
}

/* Screenshot Page */
.screenshot-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 20px;
    border: 1px solid #444;
    border-radius: 4px;
}

/* System Info & Processes (for iframe) */
body.iframe-content {
    padding: 10px; /* Reduced padding for iframe */
    background-color: transparent; /* Allow iframe background to show */
}

.info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 15px;
    align-items: center;
    font-size: 0.9em;
}

.info-grid dt {
    font-weight: bold;
    text-align: right;
    color: #ccc;
}

.info-grid dd {
    margin: 0;
    color: #e0e0e0;
}

progress {
    width: 100%;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #555;
    background-color: #333; /* Background of the progress bar track */
}

/* Styling the progress bar value */
progress::-webkit-progress-bar {
    background-color: #333;
    border-radius: 3px;
}

progress::-webkit-progress-value {
    background-color: #4CAF50; /* Green progress */
    border-radius: 3px;
    transition: width 0.5s ease;
}

progress::-moz-progress-bar {
    background-color: #4CAF50; /* Green progress */
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Process Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

th, td {
    border: 1px solid #444; /* Darker borders */
    padding: 6px 10px;
    text-align: left;
}

th {
    background-color: #333; /* Dark header */
    color: #fff;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #252525; /* Slightly different dark for alternating rows */
}

tr:hover {
    background-color: #383838; /* Highlight on hover */
}

small {
    font-size: 0.8em;
    color: #aaa;
    display: block;
    margin-top: 15px;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container, .login-container {
        padding: 15px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header nav {
        margin-top: 15px;
        margin-left: 0; /* Reset margin */
        width: 100%;
        text-align: center;
    }
     .header nav a {
        margin: 0 10px;
    }
    .button-grid {
        grid-template-columns: 1fr; /* Stack buttons vertically */
    }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
}

/* Docker Apps Page Styles */
.docker-container-list {
  margin-top: 20px;
  border-collapse: collapse; /* Use collapse for cleaner borders */
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.docker-container-list th,
.docker-container-list td {
  border: 1px solid #ddd; /* Lighter border for visibility on dark */
  padding: 10px 12px; /* Increased padding */
  text-align: left;
  vertical-align: middle; /* Align content vertically */
}
body .container .docker-container-list th { /* Increased specificity */
  background-color: #333; /* Dark header consistent with other tables */
  font-weight: bold;
  color: #fff;
}
body .container .docker-container-list tr:nth-child(even) { /* Increased specificity */
  background-color: #252525; /* Consistent alternating row color */
}
.docker-container-list tr:hover {
  background-color: #383838; /* Consistent hover color */
}
.status {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  text-transform: capitalize; /* Nicer display */
  display: inline-block; /* Ensure background covers text */
  min-width: 60px; /* Minimum width for consistency */
  text-align: center;
}
.status-running { background-color: #28a745; } /* Green */
.status-exited, .status-created, .status-paused, .status-dead { background-color: #dc3545; } /* Red for various stopped states */
.status-restarting { background-color: #ffc107; color: black; } /* Yellow */
.action-button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}
.start-button { background-color: #28a745; } /* Green */
.start-button:hover { background-color: #218838; } /* Darker Green */
.stop-button { background-color: #dc3545; } /* Red */
.stop-button:hover { background-color: #c82333; } /* Darker Red */
.action-form {
    display: inline; /* Keep buttons on the same line */
    margin: 0;
}
.error-message {
    color: #dc3545; /* Red */
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c6cb; /* Red border */
    padding: 10px;
    margin-top: 15px;
    border-radius: 4px;
    color: #721c24; /* Darker red text for better readability */
}
.footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #aaa;
}
