/* Automation Plugin Styles - Integrated with WS Theme System */
/* Note: Page/component-specific styles are in scoped .razor.css files */

/* ==============================================
   AUTOMATION LAYOUT STRUCTURE
   ============================================== */

/* Automation Container Layout */
.automation-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--ws-bg-body);
    color: var(--ws-text-base);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.automation-sidebar {
    width: 280px;
    background-color: var(--ws-navmenu-bg);
    color: var(--ws-navmenu-text);
    overflow-y: auto;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.automation-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.automation-top-row {
    background-color: var(--ws-appbar-bg);
    border-bottom: var(--ws-appbar-border-bottom-width) solid var(--ws-appbar-border-bottom-color);
    padding: 0 1rem;
    height: 3.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.automation-top-row a {
    color: var(--ws-appbar-text);
    text-decoration: none;
}

.automation-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    background-color: var(--ws-bg-body);
    color: var(--ws-text-base);
}

/* ==============================================
   AUTOMATION NAVIGATION MENU
   ============================================== */

.automation-nav-menu {
    padding: 0;
}

.automation-brand {
    padding: 0 1rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ws-border-muted);
    margin-bottom: 1rem;
}

.automation-brand h3 {
    color: var(--ws-navmenu-text);
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.automation-brand .oi {
    color: var(--ws-primary);
    margin-right: 0.5rem;
}

.ws-automation-nav-section-header {
    color: var(--ws-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 1rem 1rem 0.5rem 1rem;
    margin-top: 0.5rem;
}

.automation-nav-menu .nav-item {
    margin-bottom: 0.25rem;
}

.automation-nav-menu .nav-link {
    color: var(--ws-navmenu-text);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.automation-nav-menu .nav-link:hover {
    background-color: var(--ws-navmenu-bg-hover);
    border-left-color: var(--ws-primary);
}

.automation-nav-menu .nav-link.active {
    background-color: var(--ws-primary);
    color: var(--ws-primary-text);
    border-left-color: var(--ws-primary-text);
    font-weight: 600;
}

.automation-nav-menu .nav-link .oi {
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* ==============================================
   CARDS (scoped under .automation-content)
   ============================================== */

.automation-content .card {
    border: 1px solid var(--ws-border-muted);
    box-shadow: var(--ws-box-shadow-surface);
    margin-bottom: 1.5rem;
    background-color: var(--ws-bg-base);
    color: var(--ws-text-base);
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: var(--ws-border-radius);
}

.automation-content .card-body {
    background-color: var(--ws-bg-base);
    color: var(--ws-text-base);
}

.automation-content .card-header {
    background-color: var(--ws-bg-alt);
    border-bottom: 2px solid var(--ws-border-muted);
    font-weight: 600;
    color: var(--ws-text-base);
}

.automation-content .card-header h5 {
    margin: 0;
    color: var(--ws-text-base);
}

.automation-content .card-header .oi {
    margin-right: 0.5rem;
    color: var(--ws-primary);
}

/* ==============================================
   PAGE STYLES (prefixed)
   ============================================== */

.ws-automation-page-header {
    border-bottom: 2px solid var(--ws-border-muted);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.ws-automation-page-title {
    color: var(--ws-text-base);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.ws-automation-page-title .oi {
    color: var(--ws-primary);
    margin-right: 1rem;
}

/* ==============================================
   TASK STATUS BADGES (prefixed, shared across pages)
   ============================================== */

.ws-automation-task-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.ws-automation-task-status-pending {
    background-color: var(--ws-warning);
    color: white;
}

.ws-automation-task-status-inprogress {
    background-color: var(--ws-primary);
    color: white;
}

.ws-automation-task-status-completed {
    background-color: var(--ws-success);
    color: white;
}

.ws-automation-task-status-cancelled {
    background-color: var(--ws-text-muted);
    color: white;
}

.ws-automation-task-status-expired {
    background-color: var(--ws-danger);
    color: white;
}

/* ==============================================
   SYNCFUSION BUTTON CUSTOMIZATIONS
   (scoped under .automation-container)
   ============================================== */

.automation-container .e-btn.e-flat,
.automation-container .e-btn.e-flat:hover,
.automation-container .e-btn.e-flat:focus {
    color: var(--ws-text-base);
}

.automation-container .e-btn.e-flat:disabled {
    color: var(--ws-text-muted);
}

/* ==============================================
   SYNCFUSION GRID CUSTOMIZATIONS
   (scoped under .automation-container)
   ============================================== */

.automation-container .e-grid .e-toolbar {
    background-color: var(--ws-bg-alt);
    border-bottom: 2px solid var(--ws-border-muted);
    transition: background-color 0.3s ease;
}

.automation-container .e-grid .e-headercell {
    background-color: var(--ws-bg-alt);
    font-weight: 600;
    color: var(--ws-text-base);
}

.automation-container .e-grid .e-row:hover {
    background-color: var(--ws-table-bg-color-hover);
}

/* ==============================================
   SYNCFUSION DIAGRAM CUSTOMIZATIONS
   (scoped under .automation-container)
   ============================================== */

.automation-container .e-diagram {
    background-color: var(--ws-bg-base);
}

/* ==============================================
   SYNCFUSION DIALOG CUSTOMIZATIONS
   (scoped under .ws-automation-dialog)
   ============================================== */

.ws-automation-dialog {
    background-color: var(--ws-bg-base);
    color: var(--ws-text-base);
    border-color: var(--ws-border-muted);
}

.ws-automation-dialog .e-dlg-header {
    background-color: var(--ws-bg-alt);
    color: var(--ws-text-base);
    border-bottom-color: var(--ws-border-muted);
}

.ws-automation-dialog .e-dlg-header-content {
    background-color: var(--ws-bg-alt);
}

.ws-automation-dialog .e-dlg-content {
    background-color: var(--ws-bg-base);
    color: var(--ws-text-base);
}

.ws-automation-dialog .e-footer-content {
    background-color: var(--ws-bg-base);
    border-top-color: var(--ws-border-muted);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 768px) {
    .automation-container {
        flex-direction: column;
    }

    .automation-sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }

    .automation-main {
        height: auto;
    }

    .ws-automation-page-title {
        font-size: 1.5rem;
    }
}

/* ==============================================
   SCROLLBAR STYLING
   ============================================== */

.automation-sidebar::-webkit-scrollbar,
.automation-content::-webkit-scrollbar {
    width: 8px;
}

.automation-sidebar::-webkit-scrollbar-track {
    background: var(--ws-bg-muted);
}

.automation-sidebar::-webkit-scrollbar-thumb {
    background: var(--ws-border-base);
    border-radius: 4px;
}

.automation-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--ws-text-muted);
}

.automation-content::-webkit-scrollbar-track {
    background: var(--ws-bg-body);
}

.automation-content::-webkit-scrollbar-thumb {
    background: var(--ws-border-base);
    border-radius: 4px;
}

.automation-content::-webkit-scrollbar-thumb:hover {
    background: var(--ws-text-muted);
}

/* ==============================================
   DARK MODE OVERRIDES
   (scoped under .automation-content / .automation-container / .ws-automation-dialog)
   ============================================== */

/* Form control plaintext styling */
[data-bs-theme="dark"] .automation-content .form-control-plaintext {
    color: var(--ws-text-base);
}

/* Ensure Bootstrap text utilities respect dark mode */
[data-bs-theme="dark"] .automation-content .text-dark {
    color: var(--ws-text-base) !important;
}

/* Pre/Code blocks in response display */
[data-bs-theme="dark"] .automation-content pre.bg-light {
    background-color: var(--ws-bg-alt) !important;
    color: var(--ws-text-base);
    border: 1px solid var(--ws-border-muted);
}

/* Table headers */
[data-bs-theme="dark"] .automation-content .table-light th,
[data-bs-theme="dark"] .automation-content thead.table-light {
    background-color: var(--ws-bg-alt) !important;
    color: var(--ws-text-base);
}

/* ==============================================
   DARK MODE - DIALOG OVERRIDES
   (scoped under .ws-automation-dialog)
   ============================================== */

/* All labels inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .form-label,
[data-bs-theme="dark"] .ws-automation-dialog label,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .form-label,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content label,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .form-label,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content label {
    color: var(--ws-text-base) !important;
}

/* Help text / muted text inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog small.text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content small.text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content small.text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .text-muted,
[data-bs-theme="dark"] .ws-automation-dialog .token-textbox-wrapper small.text-muted {
    color: var(--ws-text-muted) !important;
}

/* All text within dialog content */
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content p,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content span,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content div,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content li,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content strong {
    color: var(--ws-text-base);
}

/* Syncfusion inputs inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .e-input-group,
[data-bs-theme="dark"] .ws-automation-dialog .e-input-group.e-control-wrapper,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-input-group,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-input-group.e-control-wrapper {
    background-color: var(--ws-bg-alt) !important;
    border-color: var(--ws-border-base) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-input-group input.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-input-group textarea.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-input-group input.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-input-group textarea.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content input.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content textarea.e-input {
    background-color: var(--ws-bg-alt) !important;
    color: var(--ws-text-base) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-input-group input.e-input::placeholder,
[data-bs-theme="dark"] .ws-automation-dialog .e-input-group textarea.e-input::placeholder,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content input.e-input::placeholder,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content textarea.e-input::placeholder {
    color: var(--ws-text-muted) !important;
}

/* Dropdown icon inside dialog */
[data-bs-theme="dark"] .ws-automation-dialog .e-input-group-icon,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-input-group-icon {
    color: var(--ws-text-muted) !important;
    background-color: transparent !important;
}

/* Dropdown popup inside dialog */
[data-bs-theme="dark"] .ws-automation-dialog .e-ddl.e-popup,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-ddl.e-popup {
    background-color: var(--ws-bg-base) !important;
    border-color: var(--ws-border-muted) !important;
}

/* Alert boxes inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .alert,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .alert,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .alert {
    color: var(--ws-text-base);
}

[data-bs-theme="dark"] .ws-automation-dialog .alert-info,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .alert-info,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .alert-info {
    background-color: rgba(77, 212, 255, 0.1);
    border-color: rgba(77, 212, 255, 0.2);
    color: var(--ws-text-base);
}

[data-bs-theme="dark"] .ws-automation-dialog .alert-info strong,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .alert-info strong {
    color: var(--ws-info);
}

[data-bs-theme="dark"] .ws-automation-dialog .alert-danger,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .alert-danger,
[data-bs-theme="dark"] .ws-automation-dialog .node-config-content .alert-danger {
    background-color: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: var(--ws-text-base);
}

[data-bs-theme="dark"] .ws-automation-dialog .alert-danger strong {
    color: var(--ws-danger);
}

/* Tabs inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .e-tab .e-tab-header,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-tab .e-tab-header {
    background-color: var(--ws-bg-alt) !important;
    border-bottom-color: var(--ws-border-muted) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-tab .e-toolbar-item .e-tab-text,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-tab .e-toolbar-item .e-tab-text {
    color: var(--ws-text-base) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-tab .e-toolbar-item.e-active .e-tab-text,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-tab .e-toolbar-item.e-active .e-tab-text {
    color: var(--ws-primary) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-tab .e-content,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-tab .e-content {
    background-color: var(--ws-bg-base) !important;
    color: var(--ws-text-base) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-tab .e-indicator,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-tab .e-indicator {
    background-color: var(--ws-primary) !important;
}

/* Switch component inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .e-switch-wrapper,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-switch-wrapper {
    color: var(--ws-text-base);
}

/* Numeric textbox inside dialogs */
[data-bs-theme="dark"] .ws-automation-dialog .e-numeric input.e-input,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-numeric input.e-input {
    background-color: var(--ws-bg-alt) !important;
    color: var(--ws-text-base) !important;
}

[data-bs-theme="dark"] .ws-automation-dialog .e-numeric .e-spin-up,
[data-bs-theme="dark"] .ws-automation-dialog .e-numeric .e-spin-down,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-numeric .e-spin-up,
[data-bs-theme="dark"] .ws-automation-dialog .e-dlg-content .e-numeric .e-spin-down {
    color: var(--ws-text-muted) !important;
}

/* form-control-plaintext in properties panel */
[data-bs-theme="dark"] .automation-container .form-control-plaintext {
    color: var(--ws-text-base) !important;
}
