/* Industrial PLC HMI Theme - Imperial Kuat Drive Yards */
/* Authentic industrial control system styling */

:root {
    /* Industrial PLC Color Scheme */
    --primary-color: #00ccff;
    /* Industrial cyan for active elements */
    --accent-color: #ff6600;
    /* Warning orange */
    --imperial-red: #cc0000;
    /* Imperial accent */
    --bg-color: #2a2a2a;
    /* Industrial gray background */
    --panel-bg: #3a3a3a;
    /* Panel backgrounds */
    --control-bg: #404040;
    /* Control element background */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-disabled: #808080;

    /* Industrial Typography */
    --font-header: 'Arial', 'Liberation Sans', sans-serif;
    /* Standard industrial font */
    --font-mono: 'Courier New', 'Liberation Mono', monospace;
    --font-display: 'Arial Black', 'Liberation Sans', sans-serif;

    /* Industrial Status Colors */
    --status-ok: #00ff00;
    /* Bright green for OK */
    --status-warn: #ffff00;
    /* Yellow for warnings */
    --status-error: #ff0000;
    /* Red for errors */
    --status-inactive: #808080;
    /* Gray for inactive */
    --border-color: #666666;

    /* Industrial Control Colors */
    --button-normal: #5a5a5a;
    --button-pressed: #404040;
    --button-hover: #6a6a6a;
    --input-bg: #1a1a1a;
    --alarm-critical: #ff0000;
    --alarm-high: #ff8800;
    --alarm-medium: #ffff00;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255, 255, 255, .15) 1px, transparent 0);
    background-size: 20px 20px;
    color: var(--text-primary);
    font-family: var(--font-header);
    font-size: 12px;
    /* Standard industrial HMI font size */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.2;
}

/* Industrial HMI Header */
.page-header {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border-bottom: 3px solid var(--border-color);
    border-top: 1px solid #666;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-header);
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 40px;
}

.brand-logo {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.brand-logo::before {
    content: "■";
    color: var(--imperial-red);
    font-size: 14px;
}

.top-nav {
    font-family: var(--font-header);
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid transparent;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s;
}

.top-nav a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(0, 204, 255, 0.1);
}

.page-footer {
    background: #050505;
    border-top: 1px solid #333;
    padding: 10px;
    text-align: center;
    font-size: 0.7em;
    color: #444;
    font-family: var(--font-mono);
    position: fixed;
    bottom: 0;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 10px auto 60px auto;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Industrial Control Panel Styling */
.panel {
    background: linear-gradient(145deg, var(--panel-bg) 0%, #303030 100%);
    border: 2px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    padding: 15px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: 15px;
    text-align: left;
    position: relative;
    font-size: 11px;
}

/* Industrial Panel Header Styling */
.panel::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 10px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--primary-color);
}

.panel::after {
    content: "";
    position: absolute;
    top: -3px;
    right: 10px;
    width: 6px;
    height: 6px;
    background: var(--imperial-red);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--imperial-red);
}

/* Header Styling (Panel Internal) */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-title {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5em;
    letter-spacing: 2px;
    font-family: var(--font-header);
}

.header-meta {
    font-family: var(--font-mono);
    color: #666;
    font-size: 0.8em;
    text-align: right;
}

/* Industrial Control Buttons */
button,
.btn {
    background: linear-gradient(180deg, var(--button-normal) 0%, var(--button-pressed) 100%);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-top: 2px solid #777;
    border-left: 2px solid #777;
    border-right: 2px solid #444;
    border-bottom: 2px solid #444;
    padding: 6px 12px;
    font-family: var(--font-header);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 10px;
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-height: 24px;
}

button:hover,
.btn:hover {
    background: linear-gradient(180deg, var(--button-hover) 0%, var(--button-normal) 100%);
}

button:active,
.btn:active {
    background: linear-gradient(180deg, var(--button-pressed) 0%, var(--button-hover) 100%);
    border-top: 2px solid #444;
    border-left: 2px solid #444;
    border-right: 2px solid #777;
    border-bottom: 2px solid #777;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(180deg, #cc4400 0%, #884400 100%);
    color: var(--text-primary);
    border-top: 2px solid #ee6600;
    border-left: 2px solid #ee6600;
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #dd5500 0%, #996600 100%);
}

/* Industrial Form Inputs */
input[type="text"],
input[type="password"] {
    background: var(--input-bg);
    border: 2px inset var(--border-color);
    color: var(--primary-color);
    padding: 4px 8px;
    width: 120px;
    font-family: var(--font-mono);
    text-align: center;
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3);
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow:
        inset 2px 2px 4px rgba(0, 0, 0, 0.3),
        0 0 6px rgba(0, 204, 255, 0.5);
}

/* System Log Box (Terminal) */
.terminal-log,
.dump {
    background: #000;
    border: 1px solid #333;
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: #999;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 30px;
    white-space: pre-wrap;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-ok {
    background-color: var(--status-ok);
    box-shadow: 0 0 8px var(--status-ok);
}

.status-warn {
    background-color: var(--status-warn);
    box-shadow: 0 0 8px var(--status-warn);
}

.status-error {
    background-color: var(--status-error);
    box-shadow: 0 0 8px var(--status-error);
}

.top-nav {
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

/* ... existing styles ... */

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    text-align: left;
}

.data-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.data-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-family: var(--font-header);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-value {
    font-size: 1.2rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

h1,
h2,
h3 {
    margin-top: 0;
    font-family: var(--font-header);
}

/* Specific Page Overrides */
.mono {
    font-family: var(--font-mono);
}