/* WinCC Classic Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background-color: #c0c0c0;
    color: #333;
    overflow-x: hidden;
}

.wincc-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #c0c0c0;
}

/* Header Bar */
.header-bar {
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border-bottom: 2px solid #808080;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #808080;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 32px;
    height: 32px;
}

.plant-name {
    font-weight: bold;
    font-size: 16px;
    color: #0066cc;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
}

.user-name {
    font-weight: bold;
    color: #333;
}

.datetime {
    color: #666;
    margin-top: 2px;
}

/* Navigation Bar */
.nav-bar {
    background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
    border-bottom: 1px solid #808080;
    padding: 4px 8px;
    display: flex;
    gap: 2px;
    height: 40px;
    align-items: center;
}

.nav-btn {
    background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
    border: 1px solid #808080;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.1s ease;
}

.nav-btn:hover {
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border-color: #606060;
}

.nav-btn.active {
    background: linear-gradient(to bottom, #0066cc, #004499);
    color: white;
    border-color: #003366;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #e0e0e0;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 12px;
    padding: 4px 8px;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    border: 1px solid #c0c0c0;
    border-radius: 2px;
}

/* Status Overview */
.status-overview {
    margin-bottom: 20px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.status-card {
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border: 2px solid #808080;
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #c0c0c0;
}

.status-card h3 {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid #333;
    position: relative;
}

.status-indicator.running {
    background: #00ff00;
    box-shadow: 0 0 8px #00ff00;
    animation: pulse 2s infinite;
}

.status-indicator.stopped {
    background: #ff0000;
}

.status-indicator.warning {
    background: #ffff00;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-text {
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 4px;
}

.metric-value.alarm-count {
    color: #ff6600;
}

.metric-unit {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

/* Process Areas */
.process-areas {
    margin-bottom: 20px;
}

.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.process-area {
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border: 2px solid #808080;
    padding: 16px;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #c0c0c0;
}

.process-area h3 {
    font-size: 13px;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 12px;
    text-align: center;
    padding: 4px;
    background: linear-gradient(to bottom, #e0e0ff, #d0d0ff);
    border: 1px solid #c0c0c0;
    border-radius: 2px;
}

.area-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Tank Visual */
.tank-visual {
    position: relative;
    width: 60px;
    height: 80px;
    border: 3px solid #333;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    overflow: hidden;
}

.tank-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #0066cc, #4488dd);
    transition: height 0.3s ease;
}

.tank-level {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Temperature Gauge */
.temp-gauge {
    position: relative;
    width: 80px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-meter {
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #e0e0e0, #f0f0f0);
    border: 2px solid #808080;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(to right, #00ff00, #ffff00, #ff0000);
    transition: width 0.3s ease;
}

.gauge-value {
    font-size: 14px;
    font-weight: bold;
    color: #0066cc;
    margin-top: 4px;
}

/* Fermentation Tanks */
.fermentation-tanks {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.mini-tank {
    position: relative;
    width: 20px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    overflow: hidden;
}

.mini-tank .tank-fill {
    background: linear-gradient(to top, #ff6600, #ffaa44);
}

.mini-tank span {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: bold;
}

/* Packaging Line */
.line-visual {
    width: 80px;
    height: 40px;
    position: relative;
}

.conveyor {
    width: 100%;
    height: 8px;
    background: linear-gradient(to bottom, #666, #333);
    border: 1px solid #000;
    position: relative;
    overflow: hidden;
}

.package-item {
    width: 12px;
    height: 16px;
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border: 1px solid #808080;
    position: absolute;
    top: -12px;
    animation: conveyor-move 3s linear infinite;
}

.package-item:nth-child(1) { left: 0; animation-delay: 0s; }
.package-item:nth-child(2) { left: 20px; animation-delay: -1s; }
.package-item:nth-child(3) { left: 40px; animation-delay: -2s; }

@keyframes conveyor-move {
    0% { transform: translateX(0); }
    100% { transform: translateX(80px); }
}

/* Area Data */
.area-data {
    flex: 1;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
}

.data-row span:first-child {
    color: #666;
    font-weight: normal;
}

.value {
    font-weight: bold;
    color: #0066cc;
}

.value.good {
    color: #00aa00;
}

.value.running {
    color: #00aa00;
}

.value.warning {
    color: #ff6600;
}

.value.alarm {
    color: #ff0000;
}

/* Recent Alarms */
.recent-alarms {
    margin-bottom: 20px;
}

.alarm-list {
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border: 2px solid #808080;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.alarm-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
    gap: 12px;
}

.alarm-item:last-child {
    border-bottom: none;
}

.alarm-item.high {
    background: linear-gradient(to bottom, #ffe0e0, #ffd0d0);
    border-left: 4px solid #ff0000;
}

.alarm-item.medium {
    background: linear-gradient(to bottom, #fff0e0, #ffe0d0);
    border-left: 4px solid #ff6600;
}

.alarm-item.low {
    background: linear-gradient(to bottom, #ffffd0, #ffffe0);
    border-left: 4px solid #ffff00;
}

.alarm-time {
    font-weight: bold;
    color: #0066cc;
    min-width: 60px;
}

.alarm-desc {
    flex: 1;
    color: #333;
}

.alarm-priority {
    font-weight: bold;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 2px;
    color: white;
    min-width: 50px;
    text-align: center;
}

.alarm-item.high .alarm-priority {
    background: #ff0000;
}

.alarm-item.medium .alarm-priority {
    background: #ff6600;
}

.alarm-item.low .alarm-priority {
    background: #ffaa00;
}

/* Status Bar */
.status-bar {
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border-top: 1px solid #808080;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
    font-size: 10px;
    box-shadow: inset 0 1px 0 #ffffff;
}

.system-status, .plant-metrics {
    display: flex;
    gap: 16px;
}

.status-item, .metric {
    color: #333;
    font-weight: normal;
}

.status-item {
    color: #0066cc;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .area-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .area-grid {
        grid-template-columns: 1fr;
    }
    
    .header-bar {
        flex-direction: column;
        height: auto;
        padding: 8px;
    }
    
    .nav-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }
    
    .nav-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Button Styles */
.control-button {
    background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
    border: 2px solid #808080;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s ease;
    margin: 4px;
}

.control-button:hover {
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border-color: #606060;
}

.control-button:active {
    background: linear-gradient(to bottom, #c0c0c0, #d0d0d0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.control-button.start {
    background: linear-gradient(to bottom, #90ee90, #70cc70);
    border-color: #40aa40;
}

.control-button.stop {
    background: linear-gradient(to bottom, #ff6b6b, #ff4444);
    border-color: #cc0000;
    color: white;
}

.control-button.reset {
    background: linear-gradient(to bottom, #ffd700, #ffcc00);
    border-color: #cc9900;
}

/* Input Fields */
.wincc-input {
    background: white;
    border: 2px inset #c0c0c0;
    padding: 4px 8px;
    font-size: 11px;
    font-family: Arial, sans-serif;
    color: #333;
}

.wincc-input:focus {
    outline: none;
    border-color: #0066cc;
    background: #f0f8ff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px solid #808080;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
    border: 1px solid #808080;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #d0d0d0, #b0b0b0);
}

/* Animated Elements */
.blinking {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.rotating {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
} 