/* IP Hero Card Redesign: Modern Slate Theme & Split Grid */

.hero-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
    margin: 28px 0;
}

.hero-grid-container {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
    width: 100%;
    align-items: start;
}

/* --- New Homepage Layout Styles --- */

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
}

.ip-lookup-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    /* Fix tab width stability - ensure consistent width during tab switching */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ip-lookup-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    /* Details Left (larger), Visuals Right */
    gap: 32px;
    align-items: start;
}

/* Left Column: Details */
.details-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-group {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.detail-group:first-child {
    padding-top: 0;
}

.detail-group:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.code-box {
    background: var(--kv-header-bg);
    padding: 10px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #4b5563;
    word-break: break-all;
    border: 1px solid var(--border-color);
    line-height: 1.5;
}

.detail-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.detail-row-group .detail-group {
    border-bottom: none;
    padding: 0;
}

/* Coordinate dot styling */
.coord-dot {
    color: #ef4444;
    font-size: 10px;
}

/* Right Column: Visuals */
.visual-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Hero IP Box */
.hero-ip-display {
    background: #27619B;

    border-radius: 8px;
    padding: 16px 20px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.hero-ip-title {
    font-size: 15px;
    margin-bottom: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.hero-ip-row {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hero-ip-row:last-child {
    margin-bottom: 0;
}

.hero-ip-type {
    font-weight: 600;
    opacity: 0.8;
    font-size: 14px;
    flex-shrink: 0;
}

.hero-ip-val {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    font-size: 20px;
    word-break: break-all;
    flex: 1;
    text-align: left;
}

/* Copy button styling */
.copy-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.4);
}

/* Copy icon image styling */
.copy-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    vertical-align: middle;
}

.copy-btn.copied .copy-icon {
    display: none;
}

.copy-btn.copied::after {
    content: '✓';
    font-size: 14px;
}

/* Map override for this context */
.map-hero-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 220px;
    min-height: 0;
}

#hero-map-container {
    width: 100%;
    height: 100%;
}

/* Map link */
.map-link {
    font-size: 12px;
    color: var(--link-color);
    text-decoration: none;
    text-align: right;
}

.map-link:hover {
    text-decoration: underline;
}

/* Hide My IP Button */
.hide-ip-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 24px;
    background: #dc2626;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 20px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.25);
}

.hide-ip-btn:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* IP Disclaimer */
.ip-disclaimer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ip-disclaimer a {
    color: var(--link-color);
    text-decoration: none;
}

.ip-disclaimer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .ip-lookup-grid {
        grid-template-columns: 1fr;
    }

    .detail-row-group {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .visual-column {
        order: -1;
        /* Show Map/IP first on mobile? Or keep standard? */
        /* keeping standard order for now */
    }
}

/* Mobile: Reduce font sizes and padding */
@media (max-width: 600px) {
    .section-title {
        font-size: 20px;
    }

    .section-subtitle {
        font-size: 12px;
    }

    .detail-label {
        font-size: 13px;
    }

    .detail-value {
        font-size: 14px;
    }

    .hero-ip-val {
        font-size: 16px;
    }

    .hero-ip-title {
        font-size: 13px;
    }

    .hero-ip-type {
        font-size: 12px;
    }

    .ip-lookup-section {
        padding: 10px;
    }

    .hero-ip-display {
        padding: 12px 14px;
    }

    .detail-group {
        padding: 8px 0;
    }

    .map-hero-card {
        height: 180px;
    }
}


/* Dark Mode Overrides */
body.dark-mode .code-box {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

/* Embedded Tools Grid (from index.php tabs) */
.embedded-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.embedded-tool-card {
    padding: 16px;
    background: #f8f9fa;
    border-left: 4px solid #2874A6;
    border-radius: 4px;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: block;
}

.embedded-tool-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.embedded-tool-card strong {
    font-size: 18px;
    color: #2874A6;
    display: block;
}

.embedded-tool-card p {
    margin: 8px 0 0;
    font-size: 14px;
    color: #4b5563;
}

/* Dark Mode Overrides for Embedded Tools */
body.dark-mode .embedded-tool-card {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #63b3ed;
}

body.dark-mode .embedded-tool-card strong {
    color: #63b3ed;
}

body.dark-mode .embedded-tool-card p {
    color: #cbd5e1;
}

/* Developer mode overrides for content visibility */
body.developer-mode .content-article h3,
body.developer-mode .content-article p,
body.developer-mode .section-title,
body.developer-mode .section-subtitle,
body.developer-mode .detail-label,
body.developer-mode .detail-value {
    color: var(--text-color);
}

body.developer-mode .content-article {
    background: var(--card-bg);
}

body.developer-mode .embedded-tool-card {
    background: var(--card-bg);
    border-left-color: #58a6ff;
}

body.developer-mode .embedded-tool-card strong {
    color: #58a6ff;
}

body.developer-mode .embedded-tool-card p {
    color: var(--text-muted);
}