body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #333;
}

.form-container, .table-container {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

textarea {
    height: 100px;
    resize: vertical;
}

/* Unified buttons */
/* Base button — applied to new .btn and legacy classes for backward compatibility */
.btn, .btn-submit, .btn-edit, .btn-secondary, .btn-update {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: 500 14px/1.2 Arial, sans-serif;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    user-select: none;
}

/* Primary variant — green */
.btn--primary, .btn-submit, .btn-edit, .btn-update {
    background-color: #4CAF50;
    color: #fff;
}
.btn--primary:hover, .btn-submit:hover, .btn-edit:hover, .btn-update:hover {
    background-color: #45a049;
}

.btn--primary:active {
    background-color: #3e8e41;
}

/* Secondary (neutral) */
.btn--secondary, .btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn--secondary:hover, .btn-secondary:hover {
    background-color: #d5d5d5;
}

.btn--secondary:active {
    background-color: #c9c9c9;
}

/* Focus ring for accessibility */
.btn:focus-visible, .btn-submit:focus-visible, .btn-edit:focus-visible, .btn-secondary:focus-visible, .btn-update:focus-visible {
    outline: 3px solid rgba(76, 175, 80, 0.4);
    outline-offset: 1px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.added-by {
    background-color: #f2f2f2;
    font-style: italic;
}

.content-input {
    height: 80px;
}

/* DataTables specific styling */
.dataTables_wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

.dataTables_filter input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 5px;
}

.dataTables_length select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 5px;
}

.dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.dataTables_paginate .paginate_button.current {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.dataTables_paginate .paginate_button:hover:not(.current) {
    background-color: #f2f2f2;
}

/* Ensure inputs in DataTables cells work properly */
.dataTable input[type="text"], .dataTable textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Add some spacing between DataTables controls and table */
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 10px;
}

/* Notification styles */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notification {
    background-color: #4CAF50;
    color: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.error {
    background-color: #f44336;
}

/* Run Results styles */
.run-results {
    font-size: 0.9em;
    max-width: 200px;
}

.result {
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 4px;
    font-family: monospace;
}

.result.success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
}

.result.failure {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #f44336;
}

.more-results {
    font-size: 0.8em;
    color: #777;
    font-style: italic;
    margin-top: 5px;
}

.no-results {
    color: #999;
    font-style: italic;
}

/* Header actions */
.header-actions {
    display: flex;
    justify-content: flex-end;
}

/* Modal styles */

/* Modal */
.modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none; /* hidden by default */
    background-color: rgba(0, 0, 0, 0.5);
}
/* Extra safeguard to ensure hidden unless .show */
.modal:not(.show) {
    display: none !important;
}

.modal.show {
    display: flex; /* center content */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 0;
    border: 1px solid #e6e6e6;
    width: 90%;
    max-width: 900px; /* big modal */
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 20px 20px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

/* Prevent background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.rr-emoji {
    cursor: pointer;
}