/* ============================================================
   IP Address Lookup – Professional Card UI + Responsive Search
   ============================================================ */
:root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #4a4a6a;
    --border: #e2e8f0;
    --shadow: 0 8px 24px rgba(0,0,0,0.06);
    --red: #db0601;
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --card-bg: #1c1e26;
    --text: #e4e6f0;
    --text-secondary: #a0a4b8;
    --border: #2e3140;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

/* ============================================================
   SEARCH BOX (Shortcode Output)
   ============================================================ */
.ipal-search-box-wrapper {
    margin: 20px auto;
}

.ipal-search-form {
    display: flex;
    align-items: center;
    padding: 0.2rem;
    box-sizing: border-box;
    /* background, border, border-radius are set via inline styles */
}

.ipal-icon {
    display: flex;
    align-items: center;
    padding: 0 0.8rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ipal-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    padding: 0.9rem;
    font-family: inherit;
    min-width: 0;
}

.ipal-input::placeholder {
    opacity: 1;
}

.ipal-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    margin-right: 0.3rem;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.ipal-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   MOBILE RESPONSIVE SEARCH BOX (force override inline styles)
   ============================================================ */
@media (max-width: 600px) {
    .ipal-search-box-wrapper {
        max-width: 100% !important;
    }

    .ipal-search-form {
        padding: 0.15rem !important;
        flex-wrap: nowrap !important;
    }

    .ipal-icon {
        padding: 0 0.4rem !important;
        font-size: 1rem !important;
    }

    .ipal-input {
        font-size: 14px !important;      /* smaller, fits mobile */
        padding: 0.6rem 0.4rem !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .ipal-input::placeholder {
        font-size: 14px !important;
        color: #888 !important;
        opacity: 1 !important;
    }

    .ipal-btn {
        font-size: 14px !important;
        padding: 0.5rem 1rem !important;
        margin-right: 0.1rem !important;
    }
}

/* ============================================================
   DETAIL PAGES CONTAINER
   ============================================================ */
.ipal-page-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ============================================================
   CARD VIEW
   ============================================================ */
.ipal-card-view {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* ============================================================
   LAYOUT GRIDS
   ============================================================ */
.ipal-short-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ipal-short-left {
    flex: 1 1 60%;
    min-width: 280px;
}

.ipal-short-right {
    flex: 1 1 35%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Full details two‑column cards */
.ipal-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ipal-detail-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

/* ============================================================
   CLEAN LIST (always single line)
   ============================================================ */
.ipal-clean-list {
    display: flex;
    flex-direction: column;
}

.ipal-clean-list > div {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.ipal-clean-list > div:last-child {
    border-bottom: none;
}

.ipal-clean-list span:first-child {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    flex: 0 0 45%;
    max-width: 45%;
}

.ipal-clean-list span:last-child {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    flex: 1;
    font-size: 0.95rem;
}

/* ============================================================
   MAP
   ============================================================ */
.ipal-map-box {
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.ipal-map-full .ipal-map-box {
    height: 400px;
}

/* ============================================================
   BLUE CTA BUTTON (Check My IP Address)
   ============================================================ */
.ipal-blue-btn {
    display: block;
    width: 100%;
    background: #003a87;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.ipal-blue-btn:hover {
    background: #002657;
    transform: scale(1.02);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   RED CTA BUTTON (View Full Details)
   ============================================================ */
.ipal-red-btn {
    display: block;
    width: 100%;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.ipal-red-btn:hover {
    background: #b80501;
    transform: scale(1.02);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   ACTION BUTTONS (Copy / Share / PDF)
   ============================================================ */
.ipal-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ipal-card-header-row h5,
.ipal-full-header h5 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.ipal-action-btns {
    display: flex;
    gap: 8px;
}

.ipal-icon-btn {
    background: rgba(128,128,128,0.1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipal-icon-btn:hover {
    background: rgba(128,128,128,0.25);
    transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE – TABLET / SMALL DESKTOP
   ============================================================ */
@media (max-width: 900px) {
    .ipal-short-grid {
        flex-direction: column;
    }

    .ipal-cards-grid {
        grid-template-columns: 1fr;
    }

    .ipal-map-box {
        height: 280px;
    }

    .ipal-map-full .ipal-map-box {
        height: 300px;
    }
}

/* ============================================================
   RESPONSIVE – MOBILE (detail pages)
   ============================================================ */
@media (max-width: 600px) {
    .ipal-page-container {
        margin: 15px auto;
        padding: 0 12px;
        gap: 20px;
    }

    .ipal-card-view {
        padding: 18px;
    }

    .ipal-card-header-row h5,
    .ipal-full-header h5 {
        font-size: 1.2rem;
    }

    .ipal-clean-list > div {
        padding: 6px 0;
    }

    .ipal-clean-list span:first-child {
        font-size: 0.85rem;
        flex: 0 0 50%;
        max-width: 50%;
    }

    .ipal-clean-list span:last-child {
        font-size: 0.85rem;
    }

    .ipal-blue-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .ipal-red-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .ipal-map-box {
        height: 220px !important;
    }
}

/* ============================================================
   OPTIONAL FADE‑IN ANIMATION
   ============================================================ */
.ipal-short-left,
.ipal-short-right,
.ipal-card-view {
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}