/* Основные стили - киберпанк / Mr. Robot тема */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --text-primary: #00ff41;
    --text-secondary: #0088ff;
    --text-dim: #00cc88;
    --border-color: #00ff41;
    --glow-color: rgba(0, 255, 65, 0.3);
    --error-color: #ff0055;
    --warning-color: #ffff00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', 'Fira Code', monospace;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    text-shadow: 0 0 5px var(--text-primary);
}

/* Эффект шума */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 65, 0.03) 0px,
        rgba(0, 0, 0, 0.3) 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.ascii-art {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 20px;
    text-align: center;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px var(--text-secondary); }
    to { text-shadow: 0 0 15px var(--text-secondary); }
}

.terminal-line {
    border-left: 3px solid var(--text-primary);
    padding-left: 15px;
    margin: 10px 0;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.service-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px var(--glow-color);
    transition: all 0.3s ease;
    animation: terminal-glow 3s infinite;
}

@keyframes terminal-glow {
    0% { box-shadow: 0 0 5px var(--glow-color); }
    50% { box-shadow: 0 0 20px var(--glow-color); }
    100% { box-shadow: 0 0 5px var(--glow-color); }
}

.service-card::before {
    content: "┌──►";
    position: absolute;
    top: -12px;
    left: 10px;
    background: var(--bg-primary);
    padding: 0 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
}

.service-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.service-status {
    font-size: 14px;
    padding: 3px 10px;
    border: 1px solid;
    position: relative;
    animation: blink 1.5s infinite;
}

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

.status-online {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(0, 255, 65, 0.1);
}

.status-offline {
    color: var(--error-color);
    border-color: var(--error-color);
    background: rgba(255, 0, 85, 0.1);
}

.status-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
    background: rgba(255, 255, 0, 0.1);
}

.service-details {
    font-size: 13px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 3px 0;
    border-bottom: 1px dotted rgba(0, 255, 65, 0.2);
}

.detail-label {
    color: var(--text-dim);
    opacity: 0.8;
}

.detail-value {
    font-weight: bold;
}

.uptime-bar {
    margin-top: 15px;
    height: 4px;
    background: #222;
    position: relative;
}

.uptime-fill {
    height: 100%;
    background: var(--text-primary);
    width: 0%;
    box-shadow: 0 0 10px var(--text-primary);
}

.console-log {
    margin-top: 40px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.log-header {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: bold;
}

.log-entry {
    font-size: 12px;
    margin: 5px 0;
    padding-left: 15px;
    border-left: 2px solid var(--text-primary);
    animation: type 0.1s steps(20);
}

@keyframes type {
    from { width: 0; }
    to { width: 100%; }
}

.footer {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glitch-link {
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.glitch-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
    animation: glitch 0.3s ease;
}

@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); }
}

.update-interval {
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.6;
}

/* Скроллбар в стиле терминала */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-primary);
    border: 1px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Эффект печатающегося текста */
.terminal-line:first-of-type {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 3s steps(40, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.port-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.port-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(0, 255, 65, 0.05);
    border-radius: 3px;
}

.port-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.port-status {
    font-weight: bold;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
}

.port-status.status-online {
    color: var(--text-primary);
    background: rgba(0, 255, 65, 0.1);
}

.port-status.status-offline {
    color: var(--error-color);
    background: rgba(255, 0, 85, 0.1);
}

/* ========== УЛУЧШЕННАЯ МОБИЛЬНАЯ АДАПТАЦИЯ ========== */

/* Для очень маленьких экранов (до 480px) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .ascii-art {
        font-size: 6px !important;
        line-height: 1.1;
        letter-spacing: -0.5px;
        white-space: pre-wrap;
        word-break: break-all;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .service-card {
        padding: 12px;
    }
    
    .service-name {
        font-size: 14px;
        letter-spacing: 1px;
    }
    
    .service-status {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .detail-item {
        font-size: 11px;
        margin: 4px 0;
    }
    
    .port-details {
        grid-template-columns: 1fr;
        gap: 4px;
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .port-detail {
        padding: 3px 6px;
    }
    
    .port-label {
        font-size: 10px;
    }
    
    .port-status {
        font-size: 10px;
    }
    
    .footer {
        flex-direction: column;
        gap: 8px;
        font-size: 10px;
        padding: 12px;
    }
    
    .terminal-line {
        font-size: 11px;
        padding-left: 8px;
    }
    
    .uptime-bar {
        height: 3px;
        margin-top: 10px;
    }
}

/* Для планшетов (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .ascii-art {
        font-size: 8px;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .service-card {
        padding: 15px;
    }
    
    .service-name {
        font-size: 15px;
    }
    
    .port-details {
        grid-template-columns: 1fr;
    }
}

/* Для больших телефонов в ландшафте */
@media (max-width: 900px) and (orientation: landscape) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ascii-art {
        font-size: 6px;
    }
}

/* Touch-friendly улучшения */
@media (hover: none) and (pointer: coarse) {
    .glitch-link {
        padding: 12px;
        display: inline-block;
    }
    
    .glitch-link:hover {
        animation: none;
    }
}

/* Для экранов с высоким разрешением */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
