/* These come from n8n-workflow repo change them there not here so ask for StrategyContent color scheme.   */
:root {
    --bg-color: transparent; /* Allow page background to show through */
    --sidebar-bg: rgba(21, 23, 30, 0.6); /* Glassy dark grey */
    --content-bg: rgba(13, 14, 18, 0.7);  /* A slightly different glass for content */
    --text-primary: #eef1f5;
    --text-secondary: #94a3b8;
    --accent: #ff4d4d;
    --accent-gradient: linear-gradient(135deg, #ff4d4d, #f9cb28);
    --glass-bg: rgba(255, 255, 255, 0.07); /* For smaller elements on top */
    --glass-border: rgba(255, 255, 255, 0.15); /* Highlighted edges */
    --hover-bg: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--text-secondary);
    font-weight: 400;
}

.search-wrapper {
    position: relative;
    width: 400px;
}

#nodeSearch {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 10px 16px 10px 40px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#nodeSearch:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.header-options {
    margin-left: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input {
    margin-right: 8px;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 25%;
    min-width: 280px;
    max-width: 400px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-button {
    flex: 1;
    padding: 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-button:hover {
    background: var(--hover-bg);
}

.tab-button.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.tab-panel {
    display: none;
    height: 100%;
}

.tab-panel.active {
    display: flex; /* Changed to flex */
    flex-direction: column;
}


#nodesPanel {
    /* Styles for the nodes list panel, mostly inherited */
}

#workflowPanel {
    /* Styles for the workflow builder panel */
}

.workflow-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.workflow-actions {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}

.workflow-actions .btn {
    flex: 1;
    justify-content: center;
}

.workflow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--glass-bg);
    margin-bottom: 8px;
    font-size: 14px;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
}

.remove-btn:hover {
    color: var(--accent);
}

.info {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge {
    background: var(--glass-bg);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid var(--glass-border);
}

.node-items {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0 10px 20px;
}

.node-item {
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.node-item:hover {
    background: var(--hover-bg);
}

.node-item.active {
    background: var(--accent);
}

.node-item.active .node-item-name {
    color: white;
}

.node-item-name {
    font-size: 14px;
    font-weight: 500;
}

.content {
    flex: 1;
    overflow-y: auto;
    background: var(--content-bg);
    padding: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.welcome-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mobile-only {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        height: calc(100vh - 70px); /* Full height minus header */
    }

    .sidebar, .content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        border: none;
    }

    .content {
        padding: 20px;
    }

    #nodeDetail {
        display: none; /* Initially hidden on mobile */
    }

    .app-container.mobile-detail-view .sidebar {
        display: none;
    }

    .app-container.mobile-detail-view #nodeDetail {
        display: block;
    }

    .mobile-only {
        display: block !important;
    }

    .node-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .node-actions {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .node-actions .btn {
        text-align: center;
    }
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.welcome-content h1 {
    font-size: 32px;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-content p {
    color: var(--text-secondary);
}

.hidden {
    display: none;
}

.node-header-info {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.node-actions {
    margin-left: 20px;
    display: flex;
    gap: 10px;
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #d43a3a;
}

.btn.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn.btn-secondary:hover {
    background: var(--hover-bg);
}

#detailTitle {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

#detailDesc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 800px;
}

.property-group {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.property-group-header {
    background: var(--hover-bg);
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.property-group-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

.property-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.property-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
    vertical-align: top;
}

.prop-name {
    font-weight: 600;
    color: #fff;
    font-family: monospace;
}

.prop-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 4px;
}

.prop-required {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
}

.prop-type {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.prop-desc {
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.resource-section {
    margin-top: 30px;
}

.resource-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 4px;
}

.operation-section {
    margin-bottom: 24px;
    border-left: 2px solid var(--glass-border);
    padding-left: 20px;
    margin-left: 10px;
}

.operation-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Node Metadata Styles */
.metadata-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reality-checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.reality-check {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    gap: 14px;
    line-height: 1.5;
    font-size: 14px;
}

.reality-check.warning {
    border-left: 4px solid var(--accent);
}

.reality-check.tip {
    border-left: 4px solid #f9cb28;
}

.reality-check-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.reality-check-content {
    color: var(--text-primary);
}

.pattern-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pattern-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pattern-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--hover-bg);
}

.node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.node-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--sidebar-bg);
    padding: 32px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 680px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-section {
    margin-top: 24px;
}

.modal-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

#modalDiagram {
    background: var(--glass-bg);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}
