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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    background-color: #f5f5f5;
    padding: 20px;
}

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

/* Datagrid Section */
.datagrid-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.datagrid-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
}

.datagrid {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.datagrid-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 180px 140px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
}

.datagrid-body {
    /* Empty container for rows */
}

.datagrid-row {
    display: grid;
    grid-template-columns: 40px 1fr 120px 180px 140px;
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.15s ease-in-out;
    align-items: center;
}

.datagrid-row:last-child {
    border-bottom: none;
}

.datagrid-row:hover {
    background-color: #f8f9fa;
}

.datagrid-col {
    padding: 0 8px;
}

/* Status indicator */
.col-status {
    text-align: center;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.active {
    background-color: #28a745;
}

.status-indicator.inactive {
    background-color: #dc3545;
}

/* Name column */
.cron-name-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.cron-name-link:hover {
    text-decoration: underline;
}

/* Type and Schedule */
.cron-type {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.cron-schedule {
    font-size: 13px;
    color: #495057;
}

/* Actions column */
.col-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 4px 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #212529;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s ease-in-out;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.dropdown-menu a.text-danger {
    color: #dc3545;
}

.dropdown-menu a.text-danger:hover {
    background-color: #f8d7da;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 700px;
    margin: 30px auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

.close:hover {
    opacity: 0.75;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 20px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    gap: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #6c757d;
    transition: all 0.15s ease-in-out;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 500;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #212529;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-group-inline label {
    margin-bottom: 0;
    white-space: nowrap;
    min-width: 120px;
}

.form-group-inline .form-control {
    flex: 1;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-control {
    flex: 1;
}

/* Alert */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #004085;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Examples */
.examples {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-top: 10px;
}

.examples strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.examples ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.examples li {
    margin-bottom: 6px;
    font-size: 13px;
}

.examples code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.example-command {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

.example-command:hover {
    border-color: #adb5bd;
}

.example-desc {
    color: #6c757d;
    font-size: 12px;
}

/* Log Section */
.log-section {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
    margin-top: 20px;
}

.log-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.log-line strong {
    min-width: 100px;
    font-weight: 500;
    color: #212529;
}

.log-line span {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
}

.fieldset-collapsible {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0;
}

.fieldset-collapsible legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    cursor: pointer;
    user-select: none;
    background-color: #f8f9fa;
    border-radius: 4px 4px 0 0;
    transition: background-color 0.15s ease-in-out;
}

.fieldset-collapsible legend:hover {
    background-color: #e9ecef;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease-in-out;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.log-content {
    padding: 16px;
    display: none;
}

.log-content.show {
    display: block;
}

.file-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.file-display span {
    font-size: 13px;
    color: #495057;
}

.btn-outline {
    color: #007bff;
    background-color: transparent;
    border-color: #007bff;
}

.btn-outline:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

/* Small Button */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Large Modal */
.modal-lg {
    max-width: 800px;
}

/* Cron Builder Modal */
.cron-builder-modal {
    z-index: 1070;
}

.cron-preview {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 16px 20px;
    margin-top: 24px;
    text-align: center;
}

.cron-preview-description {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.cron-preview-expression {
    margin-top: 8px;
}

.cron-preview-expression code {
    display: inline-block;
    background-color: transparent;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #6c757d;
    font-weight: normal;
}

.cron-field {
    margin-bottom: 20px;
}

.cron-field > label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: #212529;
}

.cron-options-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 14px;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    background-color: #f8f9fa;
}

.radio-option:hover {
    background-color: #e9ecef;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #007bff;
    background-color: #e7f3ff;
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.radio-option span {
    font-size: 14px;
}

.inline-input {
    width: 80px;
    display: inline-block;
    padding: 4px 8px;
    font-size: 14px;
}

.inline-select {
    width: auto;
    display: inline-block;
    padding: 4px 8px;
    font-size: 14px;
}

/* File Picker Modal */
.file-picker-modal {
    z-index: 1060;
}

.file-picker-modal .modal-dialog {
    max-width: 600px;
}

.file-browser-header {
    margin-bottom: 16px;
}

.current-path {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 13px;
}

.file-actions {
    display: flex;
    gap: 6px;
}

.file-browser {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.15s ease-in-out;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #e9ecef;
}

.file-item.selected {
    background-color: #d1ecf1;
    border-left: 3px solid #007bff;
}

.file-item.folder .file-name {
    color: #007bff;
    font-weight: 500;
}

.file-icon {
    margin-right: 8px;
    font-size: 16px;
}

.file-name {
    font-size: 14px;
    color: #212529;
}

.selected-path {
    margin-top: 16px;
    padding: 8px 12px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
}

/* Log Viewer Modal */
.log-viewer-modal {
    z-index: 1080;
}

.log-viewer-modal .modal-dialog {
    max-width: 900px;
}

.log-file-info {
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.log-file-info strong {
    color: #212529;
}

.log-file-info span {
    color: #495057;
    font-family: 'Courier New', monospace;
}

.log-content-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-content-viewer::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.log-content-viewer::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.log-content-viewer::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-content-viewer::-webkit-scrollbar-thumb:hover {
    background: #666;
}
