/* Базовые переменные (светлая macOS тема) */
:root {
    --bg-desktop: #f5f5f7;
    --window-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --border-light: #d0d0d5;
    --prompt-color: #3a8c3a;
    --link-color: #0051d5;
    --link-hover: #000000;
    --button-red: #ff5f57;
    --button-yellow: #febc2e;
    --button-green: #28c940;
    --status-green: #34c759;
}

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

body {
    background-color: var(--bg-desktop);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Контейнер для трёх окон (тайловый менеджер) */
.tile-container {
    display: flex;
    gap: 16px;
    max-width: 1400px;
    width: 100%;
    height: 90vh;
    min-height: 600px;
}

/* Главное окно (левое) занимает 2/3 ширины */
.main-window {
    flex: 2;
    min-width: 0; /* для корректного сжатия */
    display: flex;
    flex-direction: column;
}

/* Правая колонка занимает 1/3 ширины */
.right-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Окна внутри правой колонки занимают равную высоту */
.monitoring-window,
.animation-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* для скролла внутри */
}

/* Общие стили для всех окон macOS */
.mac-window {
    background-color: var(--window-bg);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 6px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.title-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-light);
    user-select: none;
    flex-shrink: 0;
}

.window-buttons {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.window-buttons span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: 0.1s ease;
}

.close { background-color: var(--button-red); }
.minimize { background-color: var(--button-yellow); }
.zoom { background-color: var(--button-green); }

.window-title {
    font-size: 13px;
    font-weight: 500;
    color: #3a3a3c;
    letter-spacing: -0.01em;
    flex: 1;
    text-align: center;
    margin-right: 60px;
}

.content {
    padding: 16px 20px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary);
    overflow-y: auto;
    flex: 1;
}

/* Терминальные строки (для главного окна) */
.line {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    line-height: 1.5;
}

.prompt {
    color: var(--prompt-color);
    font-weight: 500;
    margin-right: 12px;
    min-width: 20px;
}

.timeline-period {
    font-weight: 600;
    margin-right: 8px;
    min-width: 110px;
}

.timeline-description {
    color: var(--text-secondary);
}

.contacts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.contacts a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted #aaa;
    transition: all 0.2s;
}

.contacts a:hover {
    color: var(--link-hover);
    border-bottom: 1px solid var(--link-hover);
}

.separator {
    color: #aaa;
    font-size: 13px;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: var(--text-primary);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

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

.status-bar {
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    background-color: #f9f9fb;
    font-size: 11px;
    color: #8e8e93;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    flex-shrink: 0;
}

/* Стили для мониторинга (окно справа сверху) */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-indicator {
    color: var(--status-green);
    font-size: 16px;
    line-height: 1;
    text-shadow: 0 0 4px rgba(52, 199, 89, 0.5);
}

.service-name {
    flex: 1;
    color: var(--text-primary);
}

.status-text {
    color: var(--status-green);
    font-weight: 500;
    background: rgba(52, 199, 89, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Стили для анимации (окно справа снизу) */
.animation-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
}

.animated-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    transition: opacity 0.3s;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--prompt-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Полноценное выделение строки с именем (негатив) */
.line.highlight-fullname {
    background-color: #000;
    color: #fff;
    padding: 6px 12px;
    margin: 8px -20px;  /* растягиваем на всю ширину контента */
    border-radius: 4px;
}

/* Корректировка prompt внутри выделенной строки */
.line.highlight-fullname .prompt {
    color: #fff;
    opacity: 0.9;
}

/* Выделение названий компаний (Beget.ru, Naumen.ru, Яндекс.Практикум) */
.highlight {
    background-color: #000;
    color: #fff;
    display: inline-block;
    padding: 0 4px;
    font-weight: 500;
    border-radius: 3px;
}

/* Адаптация под планшеты (вертикальное расположение окон) */
@media (max-width: 900px) {
    .tile-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
        gap: 16px;
    }

    .main-window,
    .right-column {
        flex: none;
        width: 100%;
    }

    .right-column {
        gap: 16px;
    }

    .monitoring-window,
    .animation-window {
        min-height: 300px;
    }
}

/* Адаптация под небольшие планшеты и крупные телефоны */
@media (max-width: 700px) {
    body {
        padding: 10px;
    }

    .content {
        padding: 12px;
    }

    .line {
        flex-direction: column;
        margin-bottom: 0.8rem;
    }

    .prompt {
        margin-bottom: 4px;
    }

    .timeline-period {
        min-width: auto;
    }

    .contacts {
        flex-direction: column;
        align-items: flex-start;
    }

    .separator {
        display: none;
    }

    .window-title {
        margin-right: 0;
        font-size: 12px;
    }
}

/* Мобильные устройства (до 600px) — скрываем правую колонку */
@media (max-width: 600px) {
    .right-column {
        display: none;
    }
    
    .main-window {
        flex: none;
        width: 100%;
    }
    
    .main-window .content {
        font-size: 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 450px) {
    .title-bar {
        padding: 8px 12px;
    }

    .window-buttons span {
        width: 10px;
        height: 10px;
    }
}


.main-window .content {
    font-size: 15px;
    /* остальные стили */
}
