/* Shared Layout */
body {
    overflow-y: auto;
    /* Allow scrolling on pages without #wrapper */
    height: 100vh;
    margin: 0;
    /* cameraSettings.html defines these variables in :root or presetBoard.css, they should be available */
    background-color: var(--backgroundColor);
    color: white;
    font-family: var(--settingsFontFamily);
}

#wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--settingsFontFamily);
}

/* Page Header */
.page-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--headerBackgroundColor);
    border-bottom: 1px solid var(--borderColor);
}

.page-header h1 {
    margin: 0;
    color: #ccc;
    font-size: 1.5em;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* User Info in Header */
.user-info {
    color: #999;
    font-size: 14px;
}

.user-info strong {
    color: var(--activeColor);
}

/* Content Container */
.content-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: #388E3C;
}

.btn-primary:disabled {
    background: #555;
    cursor: not-allowed;
}

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

.btn-danger:hover {
    background: #aa0000;
}

.btn-secondary {
    background: #555;
    color: white;
}

.btn-secondary:hover {
    background: #666;
}

/* Icon Buttons (Refresh/Back) */
.icon-button {
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--borderColor);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 18px;
    color: #ccc;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: rgba(204, 0, 0, 0.2);
    color: #ff6666;
    border: 1px solid #cc0000;
}

.role-operator {
    background: rgba(255, 165, 0, 0.2);
    color: #ffaa66;
    border: 1px solid #ff8800;
}

.role-user {
    background: rgba(76, 175, 80, 0.2);
    color: #88dd88;
    border: 1px solid var(--activeColor);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--borderColor);
    border-radius: 4px;
    background: var(--backgroundColor);
    color: #ccc;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--activeColor);
}

/* Status Colors */
.status-active {
    color: var(--activeColor);
}

.status-inactive {
    color: #999;
}

.error-message {
    background: rgba(204, 0, 0, 0.2);
    border: 1px solid #cc0000;
    color: #ff6666;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.success-message {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #88dd88;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.error-message.show,
.success-message.show {
    display: block;
}

/* Modal Styles (Shared) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--buttonBackgroundColor);
    border: 1px solid var(--borderColor);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    color: var(--textColor);
    max-height: 90vh;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--borderColor);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #ccc;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--borderColor);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
}