/* Table Container */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #5568d3;
}

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: #f8f9fa;
}

.enabled-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.enabled-badge.enabled-true { 
    background: #d4edda; 
    color: #155724; 
}

.enabled-badge.enabled-false { 
    background: #f8d7da; 
    color: #721c24; 
}

code {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    margin-right: 0.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background: #5568d3;
}

button[title] {
    padding: 0.5rem;
    font-size: 1.1rem;
    line-height: 1;
}

/* Icon buttons without colors */
.icon-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 0.3rem;
    font-size: 0.9rem;
    line-height: 1;
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.icon-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.icon-btn.danger {
    background: #f8f9fa;
    color: #dc3545;
    border-color: #e0e0e0;
}

.icon-btn.danger:hover {
    background: #fff5f5;
    border-color: #f8d7da;
    color: #c82333;
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

button.danger {
    background: #dc3545;
}

button.danger:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .table-container {
        padding: 1rem;
        margin: 0 auto;
        border-radius: 12px;
        max-width: 100%;
    }

    table {
        font-size: 0.85rem;
        min-width: 500px;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .hide-mobile {
        display: none;
    }

    button {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    th, td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group small.form-hint {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.form-actions button {
    margin: 0;
}

/* Parameter Fields */
.parameter-fields {
    margin-bottom: 1rem;
}

.parameter-hint {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    border: 1px dashed #e0e0e0;
}

.parameter-hint.error {
    background: #fff5f5;
    border-color: #f8d7da;
    color: #721c24;
}

.parameter-field-group {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.parameter-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.required-badge {
    color: #dc3545;
    font-weight: 700;
    margin-left: 0.25rem;
}

.optional-badge {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.parameter-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.parameter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.parameter-input.json-input {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.parameter-input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.parameter-field-group label.parameter-label {
    display: flex;
    align-items: center;
}

/* Mobile Responsive for Modal */
@media (max-width: 768px) {
    .modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .parameter-field-group {
        padding: 0.75rem;
    }
}

