/**
 * Domen Hub — HTTP Status Checker CSS
 * Visual system adhering strictly to frozen Domen Hub tokens.
 * Zero horizontal overflow guaranteed on viewports 320px to 1440px+.
 */

/* Container & Cards */
.http-result-container {
    max-width: 1000px;
    margin: 0 auto 48px;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-card {
    background: #FFFFFF;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 1px 3px rgba(11, 29, 51, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #FAFCFE;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-primary, #0B1D33);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.http-card-body {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Status Badges */
.http-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    border-radius: var(--radius-md, 8px);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.http-badge-2xx {
    background: rgba(0, 200, 150, 0.12);
    color: #008764;
    border: 1px solid rgba(0, 200, 150, 0.3);
}

.http-badge-3xx {
    background: rgba(20, 125, 245, 0.12);
    color: #0F67D0;
    border: 1px solid rgba(20, 125, 245, 0.3);
}

.http-badge-4xx {
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.http-badge-5xx {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.http-badge-0 {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Summary Grid */
.http-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-stat-box {
    background: #F8FAFC;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.http-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-text-muted, #64748B);
    min-width: 0;
    overflow-wrap: anywhere;
}

.http-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-primary, #0B1D33);
    font-family: var(--font-mono, monospace);
    word-break: break-all;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: 100%;
}

/* Target & Final URLs */
.http-url-row {
    background: #F8FAFC;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md, 8px);
    padding: 10px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.http-url-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text-muted, #64748B);
    min-width: 90px;
    flex-shrink: 0;
    padding-top: 2px;
}

.http-url-text {
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    color: var(--brand-text, #1B2430);
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* Redirect Chain */
.http-redirect-chain {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    margin: 14px 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-chain-hop {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.http-chain-hop.is-final {
    border-color: rgba(0, 200, 150, 0.4);
    background: #FAFCFE;
}

.http-hop-num {
    background: var(--brand-surface-subtle, #F1F5F9);
    color: var(--brand-text-secondary, #475569);
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.http-hop-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.http-hop-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.http-hop-url {
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    color: var(--brand-primary, #0B1D33);
    font-weight: 600;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
}

.http-hop-location {
    font-size: 12px;
    color: var(--brand-text-secondary, #475569);
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    margin-top: 4px;
    min-width: 0;
    max-width: 100%;
}

.http-chain-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-secondary, #147DF5);
    font-size: 13px;
    margin: -3px 0 -3px 18px;
}

/* Headers Table */
.http-headers-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 10px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.http-headers-table th,
.http-headers-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--brand-border);
    font-size: 13px;
    vertical-align: top;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.http-headers-table th {
    background: #F8FAFC;
    color: var(--brand-text-muted, #64748B);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 32%;
}

.http-headers-table td {
    font-family: var(--font-mono, monospace);
    color: var(--brand-text, #1B2430);
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    min-width: 0;
}

/* Timings Card */
.http-timings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Cross Tools Bar */
.http-cross-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--brand-border);
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.http-cross-tools-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text-muted, #64748B);
    margin-right: 4px;
    min-width: 0;
}

/* Alert styling */
.http-alert-box {
    border-radius: var(--radius-md, 8px);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.http-alert-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
}

.http-alert-warning {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    color: #92400E;
}

.http-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.http-alert-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.http-alert-desc {
    font-size: 13px;
    line-height: 1.5;
    color: inherit;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Responsive down to 320px */
@media (max-width: 860px) {
    .tools-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .tools-nav {
        display: none !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px;
        padding-top: 10px;
        margin-top: 8px;
        border-top: 1px solid var(--brand-border);
    }
    .tools-nav.is-open, .tools-nav.open {
        display: flex !important;
    }
    .tools-nav-link {
        text-align: center;
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
    }
    .tools-login-btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .http-card-header {
        padding: 14px 16px;
    }
    
    .http-card-body {
        padding: 16px;
    }
    
    .http-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .http-timings-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .http-headers-table th,
    .http-headers-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .http-headers-table th {
        width: 38%;
    }
    
    .http-url-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .http-url-label {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .http-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .http-timings-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .http-headers-table {
        display: block;
        width: 100%;
    }
    
    .http-headers-table tr {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid var(--brand-border);
        padding: 6px 0;
        width: 100%;
    }
    
    .http-headers-table th,
    .http-headers-table td {
        display: block;
        width: 100%;
        border-bottom: none;
        padding: 2px 0;
        word-break: break-all !important;
        overflow-wrap: anywhere !important;
    }
    
    .http-headers-table th {
        font-size: 10px;
    }
}
