/* IP Info Plugin Styles — minimal, inherits theme fonts */

.ip-info-container {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Header: flag + IP + refresh button ────────────────────── */

.ip-info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ip-info-flag {
    font-size: 2.5rem;
    line-height: 1;
}

.ip-info-ip {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    word-break: break-all;
}

/* ── Skeleton / placeholder shimmer ──────────────────────────── */

.ip-info-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: ip-info-shimmer 1.8s ease-in-out infinite;
    border-radius: 4px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    color: transparent !important;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes ip-info-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ip-info-skeleton-header {
    width: 100%;
    max-width: 320px;
    height: 2.75rem;
    border-radius: 8px;
}

.ip-info-skeleton-location {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    max-width: 280px;
}

.ip-info-loaded .ip-info-skeleton {
    display: none !important;
}

.ip-info-loaded .ip-info-real-wrap {
    display: revert !important;
}

.ip-info-header .ip-info-refresh-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #666 !important;
    cursor: pointer !important;
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    outline: none !important;
    overflow: hidden !important;
    text-decoration: none !important;
}

.ip-info-header .ip-info-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #444 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transform: scale(1.08) !important;
}

.ip-info-header .ip-info-refresh-btn:active {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
    transform: scale(0.95) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    outline: none !important;
}

.ip-info-header .ip-info-refresh-btn::before,
.ip-info-header .ip-info-refresh-btn::after {
    display: none !important;
    content: none !important;
}

.ip-info-header .ip-info-refresh-btn:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.3) !important;
    outline-offset: 3px !important;
    background: rgba(0, 0, 0, 0.06) !important;
    color: #444 !important;
}

.ip-info-header .ip-info-refresh-btn:disabled {
    opacity: 0.4 !important;
    cursor: default !important;
    background: transparent !important;
    color: #999 !important;
    box-shadow: none !important;
}

.ip-info-header .ip-info-refresh-btn:disabled:hover {
    background: transparent !important;
    color: #999 !important;
    box-shadow: none !important;
    transform: none !important;
}

.ip-info-header .ip-info-refresh-btn:disabled:active {
    transform: none !important;
}

.ip-info-header .ip-info-refresh-btn svg {
    display: block !important;
    width: 1.6rem !important;
    height: 1.6rem !important;
    color: inherit !important;
    transition: none !important;
    will-change: transform;
    max-width: none !important;
    max-height: none !important;
}

.ip-info-header .ip-info-refresh-btn.ip-info-refreshing {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

.ip-info-header .ip-info-refresh-btn.ip-info-refreshing svg {
    animation: ip-info-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transition: none !important;
}

@keyframes ip-info-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Location: country, city ────────────────────────────────── */

.ip-info-location {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    min-height: 1.6em;
}

/* ── Browser section ────────────────────────────────────────── */

.ip-info-browser-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #333;
}

.ip-info-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-info-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.ip-info-table tr:last-child {
    border-bottom: none;
}

.ip-info-label {
    width: 30%;
    padding: 0.4rem 0.5rem 0.4rem 0.5rem;
    font-weight: 600;
    color: #555;
    vertical-align: top;
}

.ip-info-label-inner {
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

.ip-info-value {
    width: 70%;
    padding: 0.4rem 0 0.4rem 0.5rem;
    overflow-wrap: break-word;
    vertical-align: top;
}

.ip-info-ua {
    font-size: 0.8rem;
    word-break: break-all;
}

#ip-info-ipv6 {
    word-break: break-all;
}

/* ── Back link ───────────────────────────────────────────────── */

.ip-info-back-link {
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
}

.ip-info-back-link a {
    font-size: 0.95rem;
    text-decoration: underline !important;
}

/* ── Tooltip (?) icon ───────────────────────────────────────── */

.ip-info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    vertical-align: baseline;
    width: 14px;
    height: 14px;
    background-color: #ddd;
    color: #777;
    border-radius: 50%;
    text-align: center;
    line-height: 14px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 0.25em;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.ip-info-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    z-index: 10;
    bottom: 100%;
    left: 0;
    background-color: #404040;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 90vw;
    width: max-content;
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
}

.ip-info-tooltip:hover::after {
    opacity: 1;
}

/* ── Loading animation for WebRTC / IPv6 dots ──────────────── */

.ip-info-loading {
    display: inline-flex;
    gap: 0.24em;
}

.ip-info-loading span {
    display: inline-block;
    animation: ip-info-dot 1.4s infinite both;
}

.ip-info-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.ip-info-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ip-info-dot {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 640px) {
    .ip-info-flag {
        font-size: 2rem;
    }

    .ip-info-ip {
        font-size: 2rem;
    }

    .ip-info-header .ip-info-refresh-btn {
        width: 2.25rem !important;
        height: 2.25rem !important;
        min-width: 2.25rem !important;
        min-height: 2.25rem !important;
    }

    .ip-info-header .ip-info-refresh-btn svg {
        width: 1.2rem !important;
        height: 1.2rem !important;
    }

    .ip-info-skeleton-header {
        height: 2.25rem;
        max-width: 260px;
    }

    .ip-info-skeleton-location {
        font-size: 1rem;
    }

    .ip-info-location {
        font-size: 1rem;
    }

    .ip-info-label {
        width: 40%;
    }

    .ip-info-value {
        width: 60%;
    }

    .ip-info-label-inner {
        white-space: normal;
    }

    .ip-info-tooltip {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 13px;
        background-color: #e0e0e0;
        margin-left: 0.15em;
    }
}

/* ── Uniform row background: no zebra, no hover ──────────────── */

.ip-info-table tr td,
.ip-info-table tr:hover td,
.ip-info-table tr:nth-child(even) td,
.ip-info-table tr:nth-child(odd) td {
    background: #fff;
}

/* ── Remove vertical & outer borders, keep only horizontal lines ─ */

.ip-info-table,
.ip-info-table td,
.ip-info-table th {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

@media (max-width: 480px) {
    .ip-info-table,
    .ip-info-table tbody,
    .ip-info-table tr,
    .ip-info-table td {
        display: block;
        width: 100%;
        border-bottom: none !important;
    }

    .ip-info-table tr {
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }

    .ip-info-table tr:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .ip-info-label {
        padding: 0.15rem 0 0 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: #555;
    }

    .ip-info-value {
        padding: 0.1rem 0 0.3rem 0;
        font-size: 0.95rem;
    }

    .ip-info-label-inner {
        white-space: normal;
    }

    .ip-info-ua {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .ip-info-header {
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 0.3rem;
    }

    .ip-info-flag {
        font-size: 1.5rem;
    }

    .ip-info-ip {
        font-size: 1.3rem;
        line-height: 1;
        min-width: 0;
    }

    .ip-info-header .ip-info-refresh-btn {
        width: 1.5rem !important;
        height: 1.5rem !important;
        min-width: 1.5rem !important;
        min-height: 1.5rem !important;
    }

    .ip-info-header .ip-info-refresh-btn svg {
        width: 0.9rem !important;
        height: 0.9rem !important;
    }

    .ip-info-skeleton-header {
        height: 1.5rem;
        max-width: 200px;
    }

    .ip-info-table tr {
        margin-bottom: 0.5rem;
        padding-bottom: 0.3rem;
    }

    .ip-info-label {
        font-size: 0.85rem;
    }

    .ip-info-value {
        font-size: 0.9rem;
    }

    .ip-info-ua {
        font-size: 0.7rem;
    }
}
