/* ============================================
   IP Lookup Tool - Dedicated Styles
   ============================================ */

/* Hero Section */
.ip-lookup-hero {
    position: relative;
    min-height: 500px;
    height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../assets/images/ip-lookup-bg-2.webp');
    background-color: rgb(0, 3, 35);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    overflow: hidden;

    --el-width: 520px;
}

.ip-lookup-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 3, 35, .9);
    z-index: 1;
}

.ip-lookup-hero .hero-layout {
    z-index: 2;
    width: 100%;
    padding: 60px 20px;
}

.ip-lookup-hero .hero-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    text-align: center;
    align-items: center;
    justify-content: center;
}


.ip-lookup-hero .hero-title {
    color: #fff;
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0;
    text-align: center;
}

.ip-lookup-hero .hero-subtitle {
    color: #fff;
    opacity: .9;
    text-align: center;
    margin: .25rem 0 1rem;
    font-size: 1.5rem;
}

.ip-lookup-hero .hero-note {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #fff;
    opacity: .8;
    text-align: center;
    max-width: 840px;
    margin: 2rem auto 2rem;
    padding: 0 20px;
}

/* IP Input Section */
.ip-input-wrapper {
    display: flex;
    gap: 12px;
    min-width: var(--el-width);
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 1000px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #fff1;
    backdrop-filter: blur(10px);
    border: 1px solid #fff3;
    transition: 0.2s ease;
}

/* Glowing border animation during loading */
.ip-lookup-hero.loading .ip-input-wrapper {
    border: 1px solid #dc2626;
    animation: glowing-border 2s ease-in-out infinite;
}

#ip-lookup-results #location-section .info-grid {
    grid-template-rows: repeat(3, auto);
}

@keyframes glowing-border {

    0%,
    100% {
        box-shadow:
            0 0 5px rgba(220, 38, 38, 0.3),
            0 0 10px rgba(220, 38, 38, 0.2),
            0 0 20px rgba(220, 38, 38, 0.1),
            0 10px 30px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow:
            0 0 10px rgba(220, 38, 38, 0.6),
            0 0 20px rgba(220, 38, 38, 0.4),
            0 0 30px rgba(220, 38, 38, 0.3),
            0 0 40px rgba(220, 38, 38, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

.ip-input {
    flex: 1;
    padding: 14px 24px;
    padding-right: 0px;
    font-size: 1rem;
    border: none;
    background: transparent;
    color: #1e293b;
    color: #fff;
    outline: none;
}

.ip-input::placeholder {
    color: #475569;
    font-weight: 500;
    color: #fff8;
}

.lookup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 1000px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lookup-btn:hover {
    background: #b91c1c;
    transform: scale(0.98);
    box-shadow: 0 6px 20px #7f02027d;
}

.lookup-btn:active {
    transform: scale(0.9);
}

.lookup-btn img {
    filter: brightness(0) invert(1);
}

.hero-note {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 20px;
}

/* Rate Limit Warning */
.rate-limit-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 600px;
    min-width: var(--el-width);
    padding: 0px 24px;
    color: #ef4444;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rate-limit-warning.hidden {
    display: flex !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(-10px);
    filter: blur(10px);
    transition: all 0.3s ease;
}

.rate-limit-warning svg {
    width: 24px;
    height: 24px;
    fill: #ef4444 !important;
}

.rate-limit-warning svg path {
    fill: #ef4444 !important;
}

.rate-limit-warning p {
    margin: 0;
}

/* Loading State - Removed, using hero class instead */

.loading-bar {
    width: calc(var(--el-width) - 32px);
    height: 4px;
    border-radius: 1000px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ip-lookup-hero.loading .loading-bar {
    opacity: 1;
}

.loading-bar-line {
    width: 20%;
    height: 100%;
    background: var(--accent-color);
    animation: loading-bar-line 2s ease infinite;
}

@keyframes loading-bar-line {

    0%,
    100% {
        margin-left: 0%;
    }

    50% {
        margin-left: 80%;
    }
}

/* Loading State - Button */
.ip-lookup-hero.loading .lookup-btn {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.lookup-btn span::after {
    content: attr(data-loading-text);
    display: none;
}

.ip-lookup-hero.loading .lookup-btn span {
    font-size: 0;
}

.ip-lookup-hero.loading .lookup-btn span::after {
    display: inline;
    font-size: 1rem;
}


.ip-lookup-results.hidden {
    display: none;
}



/* Info Sections Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

/* Map Section */
.map-section {
    padding: 32px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e7eb;
    grid-column: 1 / -1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}


.map-section.hidden {
    display: none;
}

.map-section .section-header {
    margin-bottom: 20px;
}

.map-section .section-header svg {
    width: 2rem;
    height: 2rem;
}

.map-section .section-header svg path {
    fill: #dc2626;
}

.map-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-container {
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #f3f4f6;
}

/* Map tiles styling */
.map-tiles {
    filter: saturate(0.9) brightness(0.95) contrast(1.05);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #dc2626;
}

.leaflet-popup-content {
    margin: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
}

.leaflet-popup-content b {
    color: #dc2626;
    font-weight: 600;
    font-size: 16px;
}

.leaflet-popup-tip {
    background: #ffffff;
    border: 2px solid #dc2626;
    border-top: none;
    border-right: none;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #dc2626;
    font-size: 20px;
    padding: 8px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #b91c1c;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Section Headers */
.section-header-center {
    text-align: center;
    margin-bottom: 40px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .ip-lookup-hero .hero-title {
        font-size: 2.5rem;
    }

    .ip-lookup-hero .hero-subtitle {
        font-size: 1.25rem;
    }

    .ip-input-wrapper {
        flex-direction: column;
        border-radius: 16px;
        padding: 12px;
        min-width: 0px;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0px;
    }

    /* Remove glowing animation from wrapper on mobile */
    .ip-lookup-hero.loading .ip-input-wrapper {
        border: none;
        animation: none;
        box-shadow: none;
    }

    .ip-input {
        background: rgba(255, 255, 255, 0.95);
        padding: 12px 24px;
        border-radius: 1000px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        background: #fff1;
        border: 1px solid #fff3;
        transition: 0.2s ease;
    }

    /* Apply glowing animation to input on mobile */
    .ip-lookup-hero.loading .ip-input {
        border: 1px solid #dc2626;
        animation: glowing-border 2s ease-in-out infinite;
    }

    .lookup-btn {
        width: 100%;
        justify-content: center;
    }

    .loading-bar {
        min-width: 0px;
        width: 100%;
    }

    .insights-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-section {
        padding: 24px;
    }

    .section-title {
        font-size: 2rem;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .info-value {
        text-align: left;
    }

    .map-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ip-lookup-hero .hero-title {
        font-size: 2rem;
    }

    .ip-lookup-hero .hero-subtitle {
        font-size: 1.125rem;
    }

    .ip-lookup-hero .hero-layout {
        padding: 40px 20px;
    }

    .lookup-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .info-section .section-title {
        font-size: 1.25rem;
    }
}

/* Animation for results appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ip-lookup-results:not(.hidden) {
    animation: fadeInUp 0.5s ease-out;
}