/* Windows 98/XP Retro Style with Matrix Elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    background: #008080;
    color: #000;
    overflow: hidden;
    position: relative;
    height: 100vh;
}

/* Matrix Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Main Container */
.container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(192, 192, 192, 0.95);
}

/* Top Bar (Window Title Bar) */
.top-bar {
    background: linear-gradient(to bottom, #0054a6, #003d7a);
    color: white;
    height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-weight: bold;
    font-size: 11px;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-icon {
    font-size: 14px;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-controls button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

.window-controls button:hover {
    background: #e0e0e0;
}

.window-controls button:active {
    border-style: inset;
}

/* Menu Bar */
.menu-bar {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    height: 24px;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.menu-item {
    padding: 4px 8px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 11px;
}

.menu-item:hover {
    background: #316ac5;
    color: white;
    border: 1px solid #184c7a;
}

.menu-item.active {
    background: #316ac5;
    color: white;
    border: 1px inset #c0c0c0;
}

/* Status Bar */
.status-bar {
    background: #c0c0c0;
    border-top: 1px solid #808080;
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 10px;
    gap: 16px;
}

.status-section {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px inset #c0c0c0;
    padding: 2px 6px;
    background: #f0f0f0;
}

.status-cleaned {
    color: #0080ff;
    text-shadow: 0 0 2px #0080ff;
}

.status-online {
    color: #00ff00;
    text-shadow: 0 0 3px #00ff00;
}

.status-offline {
    color: #ff0000;
    text-shadow: 0 0 3px #ff0000;
}

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

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-title {
    color: #000080;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    text-shadow: 1px 1px 0px #ffffff;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Windows */
.window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.window-header {
    background: linear-gradient(to bottom, #0054a6, #003d7a);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-actions {
    display: flex;
    gap: 2px;
}

.mini-btn {
    width: 16px;
    height: 16px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 8px;
    cursor: pointer;
}

.mini-btn:hover {
    background: #e0e0e0;
}

.mini-btn:active {
    border-style: inset;
}

.window-content {
    padding: 12px;
    background: #f0f0f0;
    min-height: 120px;
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dotted #808080;
}

.stat-label {
    font-weight: bold;
    color: #000080;
}

.stat-value {
    color: #008000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Buttons */
.retro-btn {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    margin: 4px;
    color: #000;
}

.retro-btn:hover {
    background: #e0e0e0;
}

.retro-btn:active {
    border-style: inset;
}

.retro-btn.primary {
    background: #316ac5;
    color: white;
    border-color: #316ac5;
}

.retro-btn.secondary {
    background: #008080;
    color: white;
    border-color: #008080;
}

.retro-btn.warning {
    background: #ff8000;
    color: white;
    border-color: #ff8000;
}

.retro-btn.danger {
    background: #c00000;
    color: white;
    border-color: #c00000;
}

.retro-btn.full-width {
    width: 100%;
    margin: 4px 0;
}

/* Monitor Display */
.monitor-display {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 8px;
    height: 200px;
    overflow-y: auto;
    border: 2px inset #c0c0c0;
}

.monitor-line {
    margin-bottom: 2px;
    display: flex;
    gap: 8px;
}

.timestamp {
    color: #808080;
}

.log-info {
    color: #00ff00;
}

.log-success {
    color: #00ffff;
}

.log-warning {
    color: #ffff00;
}

.log-error {
    color: #ff0000;
}

.monitor-logs {
    margin-top: 8px;
}

/* Table */
.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 2px inset #c0c0c0;
}

.retro-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 11px;
}

.retro-table th {
    background: #c0c0c0;
    border: 1px solid #808080;
    padding: 4px 8px;
    text-align: left;
    font-weight: bold;
}

.retro-table td {
    border: 1px solid #e0e0e0;
    padding: 4px 8px;
}

.retro-table tbody tr:nth-child(even) {
    background: #f8f8f8;
}

.retro-table tbody tr:hover {
    background: #316ac5;
    color: white;
}

.loading {
    text-align: center;
    font-style: italic;
    color: #808080;
}

/* Progress Bar */
.progress-container {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: white;
    border: 2px inset #c0c0c0;
    position: relative;
}

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

.progress-text {
    text-align: center;
    margin-top: 4px;
    font-size: 10px;
    color: #000080;
    font-weight: bold;
}

/* Sync Controls */
.sync-controls {
    text-align: center;
}

.sync-stats {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.4;
}

/* Terminal */
.terminal {
    background: #000;
    color: #c0c0c0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    border: 2px inset #c0c0c0;
}

.terminal-header {
    background: #000080;
    color: white;
    padding: 4px 8px;
    font-weight: bold;
}

.terminal-content {
    padding: 8px;
    height: 300px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
}

.log-timestamp {
    color: #808080;
}

.log-level {
    font-weight: bold;
    min-width: 60px;
}

.log-level.info {
    color: #00ff00;
}

.log-level.warning {
    color: #ffff00;
}

.log-level.error {
    color: #ff0000;
}

.log-level.debug {
    color: #00ffff;
}

.log-message {
    color: #c0c0c0;
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dotted #808080;
}

.setting-item label {
    font-weight: bold;
    color: #000080;
}

.setting-item input,
.setting-item select {
    background: white;
    border: 2px inset #c0c0c0;
    padding: 2px 4px;
    font-size: 11px;
}

/* Security */
.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dotted #808080;
}

.security-label {
    font-weight: bold;
    color: #000080;
}

.security-status-ok {
    color: #008000;
    font-weight: bold;
}

.security-status-error {
    color: #c00000;
    font-weight: bold;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 24px;
    text-align: center;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #808080;
    border-top: 4px solid #316ac5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

.loading-text {
    font-weight: bold;
    color: #000080;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(to bottom, #0054a6, #003d7a);
    color: white;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.modal-controls {
    display: flex;
    gap: 2px;
}

.modal-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    color: #000;
}

.modal-btn:hover {
    background: #e0e0e0;
}

.modal-btn:active {
    border-style: inset;
}

.modal-content {
    flex: 1;
    padding: 16px;
    background: #f0f0f0;
    overflow-y: auto;
}

.modal-footer {
    background: #c0c0c0;
    padding: 12px;
    border-top: 1px solid #808080;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Form Styles */
.retro-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-weight: bold;
    color: #000080;
    font-size: 11px;
}

.form-row input,
.form-row select,
.form-row textarea {
    background: white;
    border: 2px inset #c0c0c0;
    padding: 4px 6px;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #316ac5;
}

.readonly-field {
    background: #f0f0f0 !important;
    color: #808080;
}

.checkbox-row {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-row textarea {
    resize: vertical;
    min-height: 60px;
    font-family: 'MS Sans Serif', sans-serif;
}

/* Status indicators in table */
.status-GEPLANT {
    color: #0066cc;
    font-weight: bold;
}

.status-BESTÄTIGT {
    color: #009900;
    font-weight: bold;
}

.status-ABGESCHLOSSEN {
    color: #666666;
    font-weight: bold;
}

.status-STORNIERT {
    color: #cc0000;
    font-weight: bold;
}

.status-unknown {
    color: #888888;
    font-style: italic;
}

/* Retro Message Box */
.retro-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    animation: messageAppear 0.3s ease-out;
}

.retro-message-content {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    min-width: 300px;
}

.retro-message-header {
    background: linear-gradient(to bottom, #0054a6, #003d7a);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.retro-message-header button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    color: #000;
}

.retro-message-body {
    padding: 16px;
    background: #f0f0f0;
    font-weight: bold;
    text-align: center;
}

.retro-message-body.success {
    color: #008000;
}

.retro-message-body.error {
    color: #c00000;
}

.retro-message-body.info {
    color: #000080;
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

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

::-webkit-scrollbar-thumb {
    background: #808080;
    border: 1px outset #808080;
}

::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

::-webkit-scrollbar-corner {
    background: #c0c0c0;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .window-content {
        padding: 8px;
    }
    
    .retro-table {
        font-size: 10px;
    }
    
    .retro-table th,
    .retro-table td {
        padding: 2px 4px;
    }
}

/* Animation for text typing effect */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* Glitch effect for Matrix style */
.glitch {
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}
