/* Хакерская консоль - стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu Mono', monospace;
    background-color: #000;
    color: #0f0;
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Анимация мигающего курсора */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Панель мониторинга */
.monitoring-panel {
    background-color: #111;
    border-bottom: 2px solid #0f0;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.panel-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.panel-title i {
    margin-right: 10px;
    color: #0f0;
}

.panel-status {
    background-color: #0a0;
    color: #000;
    padding: 5px 15px;
    border-radius: 3px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.widget {
    background-color: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 15px;
    transition: all 0.3s ease;
}

.widget:hover {
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    transform: translateY(-2px);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

.widget-title {
    font-weight: bold;
    color: #0f0;
}

.widget-status {
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 3px;
}

.widget-status.online {
    background-color: #0a0;
    color: #000;
}

.widget-status.warning {
    background-color: #aa0;
    color: #000;
}

.widget-status.offline {
    background-color: #a00;
    color: #fff;
}

.widget-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
}

.metric-label {
    color: #888;
}

.metric-value {
    color: #0f0;
    font-weight: bold;
}

/* Основной контейнер */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Консоль */
.console-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    background-color: #000;
    border-right: 1px solid #333;
    padding: 20px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.console-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.console-title i {
    margin-right: 10px;
}

.console-controls {
    display: flex;
    gap: 10px;
}

.ctrl-btn {
    background-color: #111;
    color: #0f0;
    border: 1px solid #333;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background-color: #0f0;
    color: #000;
    border-color: #0f0;
}

.console-output {
    flex: 1;
    overflow-y: auto;
    background-color: #000;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 5px;
    margin-bottom: 20px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 1.1em;
    line-height: 1.8;
}

.console-output::-webkit-scrollbar {
    width: 10px;
}

.console-output::-webkit-scrollbar-track {
    background: #111;
}

.console-output::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Кросс-браузерные скроллбары для Firefox */
.console-output, .side-panel {
    scrollbar-color: #333 #111;
    scrollbar-width: thin;
}

.command-line {
    margin-bottom: 5px;
}

.prompt {
    color: #0f0;
    font-weight: bold;
    margin-right: 10px;
}

.command {
    color: #fff;
}

.command-output {
    color: #0af;
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 2px solid #333;
    white-space: pre-wrap;       /* Сохраняет переносы строк из textContent */
    word-wrap: break-word;       /* Переносит слишком длинные строки */
}

.console-input {
    display: flex;
    align-items: center;
    background-color: #111;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 5px;
    margin-bottom: 15px;
}

.input-prompt {
    color: #0f0;
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 1.1em;
    outline: none;
    padding: 5px;
}

.command-input::placeholder {
    color: #666;
}

.cursor {
    color: #0f0;
    font-weight: bold;
    animation: blink 1s infinite;
    margin-left: 5px;
}

.console-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #333;
    font-size: 0.9em;
    color: #888;
}

.footer-text i {
    margin-right: 5px;
    color: #0f0;
}

.security-level {
    color: #0f0;
    font-weight: bold;
}

/* Боковая панель */
.side-panel {
    flex: 1;
    background-color: #111;
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid #333;
}

.side-panel::-webkit-scrollbar {
    width: 8px;
}

.side-panel::-webkit-scrollbar-track {
    background: #111;
}

.side-panel::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.side-panel::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.side-section {
    margin-bottom: 30px;
}

.side-section h3 {
    color: #0f0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    font-size: 1.1em;
}

.side-section h3 i {
    margin-right: 10px;
}

.service-list, .operations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-item, .operation-item {
    background-color: #000;
    padding: 10px;
    border-radius: 3px;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.service-item:hover, .operation-item:hover {
    border-color: #0f0;
    transform: translateX(5px);
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-name {
    color: #fff;
}

.service-status {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: bold;
}

.service-status.online {
    background-color: #0a0;
    color: #000;
}

.service-status.warning {
    background-color: #aa0;
    color: #000;
}

.service-status.offline {
    background-color: #a00;
    color: #fff;
}

.service-status i {
    margin-right: 5px;
    font-size: 0.7em;
}

.operation-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.op-time {
    color: #888;
    font-size: 0.8em;
}

.op-text {
    color: #0af;
    font-size: 0.9em;
}

.keyboard-hint {
    background-color: #000;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #333;
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.6;
}

.keyboard-hint p {
    margin-bottom: 10px;
}

.keyboard-hint p:last-child {
    margin-bottom: 0;
}

.virtual-keyboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.keyboard-row {
    display: flex;
    gap: 10px;
}

.key {
    flex: 1;
    background-color: #000;
    color: #0f0;
    border: 1px solid #333;
    padding: 12px 5px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    transition: all 0.2s ease;
    text-align: center;
}

.key:hover {
    background-color: #0f0;
    color: #000;
    border-color: #0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.key:active {
    transform: translateY(0);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
    }
    
    .console-container {
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .side-panel {
        border-left: none;
        border-top: 1px solid #333;
    }
}

@media (max-width: 768px) {
    .widgets-container {
        grid-template-columns: 1fr;
    }
    
    .console-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .keyboard-row {
        flex-wrap: wrap;
    }
    
    .key {
        min-width: calc(50% - 5px);
    }
}

/* Эффекты для хакерской тематики */
.glitch-text {
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff; }
    15% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff; }
    16% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff; }
    49% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff; }
    50% { text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff; }
    99% { text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff; }
    100% { text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff; }
}

.terminal-line {
    position: relative;
}

.terminal-line::before {
    content: '>';
    position: absolute;
    left: -20px;
    color: #0f0;
    opacity: 0.7;
}

/* Анимация загрузки */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top-color: #0f0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Эффект матрицы */
.matrix-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

/* Стили для уведомлений */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #111;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}