/* General Body and Background */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    color: #f0f0f0;
    background-color: #00030c;
    background-image: url('/background.jpg');
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

h2, h3 {
    color: #00aeff;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 0 5px rgba(0, 174, 255, 0.5);
}

/* Navigation */
.nav-links {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.nav-links a {
    text-decoration: none;
    color: #00aeff;
    margin: 0 15px;
    border: 1px solid #00aeff;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.nav-links a:hover {
    background-color: #00aeff;
    color: #fff;
    box-shadow: 0 0 10px #00aeff;
}

/* Main Container */
.user-management-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(10, 25, 47, 0.85);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 174, 255, 0.3);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
    min-width: 600px;
}

th, td {
    border: 1px solid #2a3b4f;
    padding: 12px 15px;
    text-align: left;
}

th {
    background-color: rgba(0, 174, 255, 0.2);
    color: #f0f0f0;
    font-weight: 600;
}

tr {
    transition: background-color 0.3s ease;
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

tr:hover {
    background-color: rgba(0, 174, 255, 0.1);
}

/* Form Styles */
#add-user-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0; /* Removed margin as gap is used in flex container */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #00aeff;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2a3b4f;
    border-radius: 4px;
    background-color: #0a192f;
    color: #f0f0f0;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #00aeff;
    box-shadow: 0 0 8px rgba(0, 174, 255, 0.5);
}

/* Button Styles */
.btn, button[type="submit"] {
    color: #fff;
    background: linear-gradient(45deg, #007acc, #00aeff);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    align-self: flex-start; /* Align button to the start of the form */
}

.btn:hover, button[type="submit"]:hover {
    background: linear-gradient(45deg, #0088e6, #33bbff);
    box-shadow: 0 0 12px rgba(0, 174, 255, 0.7);
}

.btn-delete {
    color: #fff;
    background-color: #c82333;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-delete:hover {
    background-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.7);
}

/* Utility and Messages */
.error-message {
    color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    display: none; /* Hidden by default */
}

#error-message:not(:empty) {
    display: block; /* Show when it has content */
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 174, 255, 0.5), transparent);
    margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body { padding: 10px; }
    .user-management-container { padding: 1rem; }
    th, td { padding: 8px; }
    .nav-links a { margin: 0 5px; padding: 6px 10px; }
}
/* Back Button Styles */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
    text-decoration: none;
    color: #00bcd4; /* 與主題色保持一致 */
    font-weight: bold;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: #00e5ff;
}

.back-button i {
    font-size: 1.2em;
}

/* Top-left Back Button Styles */
.top-left-back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000; /* 確保在最上層 */
}

.top-left-back-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 174, 255, 0.2); /* 半透明背景 */
    color: #00aeff; /* 圖示顏色 */
    font-size: 1.2em;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.top-left-back-button a:hover {
    background-color: rgba(0, 174, 255, 0.4);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 174, 255, 0.8);
    transform: scale(1.05);
}