/* PLC Explorer - Mac Classic "Desktop" Theme */

:root {
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(90deg, var(--primary) 21px, transparent 1%) center, linear-gradient(var(--primary) 21px, transparent 1%) center, var(--secondary);
    background-size: 22px 22px;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Chicago, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.menu-bar {
    z-index: 1000;
}

.desktop {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.window {
    position: absolute;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

#win-search {
    width: 250px;
    top: 20px;
    left: 20px;
}

#win-metrics {
    width: 250px;
    top: 160px;
    left: 20px;
    height: calc(100% - 170px);
    max-height: calc(100vh - 190px);
}

#win-content {
    top: 20px;
    left: 290px;
    width: calc(100% - 310px);
    height: calc(100% - 40px);
    max-height: calc(100vh - 60px);
}

.window-pane {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 10px !important;
}

.doc-section {
    display: none;
}

.doc-section.active {
    display: block;
}

/* Custom styled placeholders */
.placeholder {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 0;
    margin: 10px 0;
}

.code-block {
    background-color: #eee;
    padding: 10px;
    border: 1px solid #999;
    font-family: Monaco, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Timeline, Audit, and Graph custom styles inside windows */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ccc;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: 12px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #000080;
    z-index: 1;
}

.timeline-content {
    background: #fff;
    border: 1px solid #999;
    padding: 10px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.audit-card {
    background: #fff;
    border: 1px solid #999;
    padding: 10px;
    margin-bottom: 10px;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-success {
    background: #28a745;
}

.status-failure {
    background: #dc3545;
}

.graph-container {
    height: 400px;
    border: 1px solid #999;
    background: #fff;
    position: relative;
    overflow: hidden;
}

/* Status bar */
.status-bar {
    display: flex;
    border-top: 2px solid #000;
    background: #fff;
    padding: 2px 5px;
    font-size: 12px;
    font-family: Geneva_9, Chicago_12, monospace;
}

.status-bar-field {
    flex: 1;
    padding: 0 5px;
    margin: 0;
    border-right: 1px solid #999;
}

.status-bar-field:last-child {
    border-right: none;
}

/* Secondary button */
.btn-secondary {
    background: #fff;
    border: 1px solid #000;
    padding: 2px 8px;
    font-family: Chicago_12, monospace;
    font-size: 12px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
}

/* Param table */
.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: Geneva_9, Chicago_12, monospace;
}

.param-table th,
.param-table td {
    border: 1px solid #999;
    padding: 4px 8px;
    text-align: left;
}

.param-table th {
    background: #eee;
    font-weight: bold;
}

/* Identity graph nodes */
.node {
    position: absolute;
    padding: 5px 10px;
    border: 1px solid #000;
    background: #fff;
    font-size: 11px;
    font-family: Chicago_12, monospace;
    white-space: nowrap;
}

.node.key {
    background: #ffffcc;
}

.node.service {
    background: #ccffcc;
}