/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #FFD54F;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-radius: 10px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.header h1 {
    color: black;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: black;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: black;
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.login-info {
    margin-top: 20px;
    text-align: center;
    color: #999;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #FFD54F;
    color: black;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 213, 79, 0.6);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Machines Grid */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.machine-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.machine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.machine-header {
    margin-bottom: 15px;
}

.machine-header h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 5px;
}

.machine-id {
    color: #999;
    font-size: 12px;
    font-family: monospace;
}

.machine-id-large {
    color: #999;
    font-size: 14px;
    font-family: monospace;
}

.machine-status {
    margin-top: 15px;
}

.status-info p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

/* Status Badges */
.status-badge,
.status-badge-large {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.status-badge-large {
    padding: 10px 20px;
    font-size: 16px;
    margin: 20px 0;
}

.status-idle {
    background: #e3f2fd;
    color: #1976d2;
}

.status-busy {
    background: #fff3e0;
    color: #f57c00;
}

.status-error {
    background: #ffebee;
    color: #c62828;
}

.status-maintenance {
    background: #f3e5f5;
    color: black;
}

.status-off {
    background: #eceff1;
    color: #546e7a;
}

.status-offline {
    background: #eceff1;
    color: #546e7a;
}

.error-indicator {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 500;
}

.error-count {
    background: #c62828;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Machine Detail Page */
.breadcrumb {
    margin-bottom: 20px;
}

.breadcrumb a {
    color: black;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.machine-detail-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.machine-detail-header h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.detail-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.detail-section h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.parameter-field {
    display: flex;
    flex-direction: column;
}

.parameter-field label {
    color: #666;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parameter-field input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    background: #f9f9f9;
    font-weight: 500;
}

/* Errors Table */
.errors-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.errors-table thead {
    background: #f5f5f5;
}

.errors-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.errors-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.error-row {
    transition: background 0.2s;
}

.error-row:hover {
    background: #fafafa;
}

.error-row-resolved {
    opacity: 0.7;
}

.error-row-resolved:hover {
    background: #fafafa;
}

.severity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-warning {
    background: #fff3e0;
    color: #f57c00;
}

.severity-error {
    background: #ffebee;
    color: #c62828;
}

.severity-critical {
    background: #b71c1c;
    color: white;
}

.severity-unknown {
    background: #eceff1;
    color: #546e7a;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: black;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state-small {
    text-align: center;
    padding: 30px;
    color: #999;
}

.empty-state-small p {
    font-size: 16px;
}

/* Auto Refresh Notice */
.auto-refresh-notice {
    text-align: center;
    padding: 20px;
    color: black;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .machines-grid {
        grid-template-columns: 1fr;
    }

    .parameters-grid {
        grid-template-columns: 1fr;
    }

    .errors-table {
        font-size: 12px;
    }

    .errors-table th,
    .errors-table td {
        padding: 8px;
    }
}

h2 {
    color: black;
    margin-bottom: 10px;
}

/* I/O Control Panel */
.io-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.io-item {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.io-item:hover {
    border-color: #FFD54F;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.io-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.io-btn {
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.io-btn-high {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.io-btn-high:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.4);
}

.io-btn-low {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.io-btn-low:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(244, 67, 54, 0.4);
}

.io-btn:active {
    transform: translateY(0);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.flash-message {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    border-left: 4px solid #4caf50;
    animation: slideIn 0.3s ease-out;
}

.flash-message.error {
    border-left-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .io-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .io-item {
        padding: 12px;
    }

    .io-btn {
        padding: 8px;
        font-size: 11px;
    }
}

/* Configuration Section */
.config-loading,
.config-error {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #666;
}

.config-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.config-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.config-tab:hover {
    color: #333;
    background: #f9f9f9;
}

.config-tab.active {
    color: black;
    border-bottom-color: #FFD54F;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

.config-section {
    margin-bottom: 30px;
}

.config-section h4 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.config-field {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s;
}

.config-field:hover {
    border-color: #FFD54F;
}

.config-field label {
    display: block;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e0e0e0 0%, #ddd 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
}

.slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #e0e0e0 0%, #ddd 100%);
    border-radius: 4px;
}

.slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #e0e0e0 0%, #ddd 100%);
    border-radius: 4px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFD54F;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    border: 2px solid white;
    margin-top: -8px;
}

.slider::-webkit-slider-thumb:hover {
    background: #FFC107;
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
    background: #FFA000;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFD54F;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #FFC107;
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.slider::-moz-range-thumb:active {
    transform: scale(1.2);
    background: #FFA000;
}

.slider-value {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: white;
}

.slider-value:focus {
    outline: none;
    border-color: #FFD54F;
}

/* Timeline Visualization */
.timeline-container {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 250px;
}

.timeline-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-label {
    width: 120px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    padding-right: 15px;
}

.timeline-track {
    flex: 1;
    height: 40px;
    background: #f0f0f0;
    border-radius: 5px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-bar {
    position: absolute;
    height: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.timeline-bar:hover {
    transform: scaleY(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.timeline-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.timeline-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
    position: relative;
}

.timeline-tick {
    position: absolute;
    font-size: 11px;
    color: #999;
    font-weight: 500;
    transform: translateX(-50%);
}

/* Configuration Actions */
.config-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn-save-config,
.btn-reset-config {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save-config {
    background: #4CAF50;
    color: white;
}

.btn-save-config:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-reset-config {
    background: #f44336;
    color: white;
}

.btn-reset-config:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

@media (max-width: 768px) {
    .config-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .config-tab {
        width: 100%;
        text-align: left;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .timeline-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-label {
        width: 100%;
        padding-right: 0;
        padding-bottom: 5px;
    }

    .timeline-track {
        width: 100%;
        height: 40px;
        /* Ensure height is maintained on mobile when parent flex-direction changes */
    }

    .config-actions {
        flex-direction: column;
    }

    .btn-save-config,
    .btn-reset-config {
        width: 100%;
    }

    /* Mobile-friendly sliders - bigger and easier to use on touch screens */
    .slider {
        height: 12px;
        margin-bottom: 15px;
        margin-top: 5px;
        border-radius: 6px;
    }

    .slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
        margin-top: -10px;
    }

    .slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }

    .config-field {
        padding: 18px;
        background: white;
    }

    .config-field label {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .slider-value {
        padding: 12px;
        font-size: 16px;
        margin-top: 5px;
    }
} 
 / *   C o n t r o l   B u t t o n s   * /  
 . b t n - c o n t r o l : h o v e r   {  
         t r a n s f o r m :   t r a n s l a t e Y ( - 2 p x ) ;  
         b o x - s h a d o w :   0   5 p x   1 5 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 3 ) ;  
 }  
  
 . b t n - c o n t r o l : a c t i v e   {  
         t r a n s f o r m :   t r a n s l a t e Y ( 0 ) ;  
 }  
 