/**
 * SysKit.ru - Специфические стили для всех инструментов
 * Полная адаптивность под любые разрешения экранов
 */

/* DNS Таблица */
.dns-table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.dns-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dns-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1.5px solid var(--border-color);
    white-space: nowrap;
}

.dns-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.dns-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.dns-badge-A { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.dns-badge-AAAA { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.dns-badge-MX { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.dns-badge-TXT { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.dns-badge-NS { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }
.dns-badge-CNAME { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.dns-badge-SOA { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

/* WHOIS Raw Code Block */
.code-block-wrap {
    position: relative;
    background: var(--code-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-surface-elevated);
    border-bottom: 1.5px solid var(--border-color);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.code-pre {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 480px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
    width: 100%;
    box-sizing: border-box;
}

/* Бейджи статусов */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
}

.status-pill.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-pill.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.status-pill.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* Тайминги Ping / TTFB */
.timings-waterfall {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.timing-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    width: 100%;
}

.timing-label {
    width: 130px;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 0.8125rem;
}

.timing-bar-wrap {
    flex: 1;
    height: 10px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 40px;
}

.timing-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.timing-val {
    width: 70px;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.8125rem;
}

/* Сетка портов */
.ports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.port-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.port-item.is-open {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.port-item.is-closed {
    opacity: 0.75;
}

/* Редирект цепочка */
.redirect-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.redirect-timeline::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 0.75rem;
    width: 2px;
    background: var(--border-color);
}

.redirect-node {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.redirect-dot {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-surface);
}

/* Инструменты разработчика (Client Tools) */
.tool-workarea {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.textarea-box {
    width: 100%;
    min-height: 180px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}

.textarea-box:focus {
    border-color: var(--border-focus);
    box-shadow: var(--primary-glow);
}

.tool-actions-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--primary-glow);
}

/* Пароль генератор */
.pass-display {
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    word-break: break-all;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.pass-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   Адаптивные правила tools.css
   ========================================================================== */
@media (max-width: 640px) {
    .timing-row {
        gap: 0.5rem;
    }
    .timing-label {
        width: 100px;
        font-size: 0.75rem;
    }
    .timing-val {
        width: 60px;
        font-size: 0.75rem;
    }
    .ports-grid {
        grid-template-columns: 1fr;
    }
    .pass-display {
        flex-direction: column;
        align-items: stretch;
        font-size: 1.15rem;
        padding: 1rem;
    }
    .pass-display button {
        width: 100%;
        justify-content: center;
    }
    .pass-options {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .tool-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .tool-actions-bar .btn-primary,
    .tool-actions-bar .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .pass-options {
        grid-template-columns: 1fr;
    }
    .redirect-timeline {
        padding-left: 1.5rem;
    }
    .redirect-dot {
        left: -1.5rem;
        width: 12px;
        height: 12px;
    }
}
