* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* General Body Styles */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #3f444b 0%, #2c313a 100%);
    color: #333;
    line-height: 1.6;
}

/* Main Styles */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}

/* Header Styles */
#ip-tool-header {
    background: linear-gradient(135deg, #2b3035 0%, #1a1d21 100%);
    color: white;
    width: 100%;
    padding: 1.5rem;
    position: relative;
    margin-bottom: 2rem;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header h1 {
    color: white;
    margin: 0;
}

/* Header Content Layout */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

#main-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    gap: 2rem;
}

/* Logo Styles */
#logo-container {
    position: static;
    transform: none;
    margin-right: 2rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

#logo-container:hover {
    transform: scale(1.05);
}

#logo-container img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Navigation Styles */
#top-nav {
    position: static;
    left: auto;
}

#top-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

#top-nav ul li {
    margin-left: 1.5rem;
    position: relative;
}

#top-nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
    transition: all 0.3s ease;
    position: relative;
}

#top-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#top-nav ul li a:hover {
    color: #007bff;
}

#top-nav ul li a:hover::after {
    width: 100%;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, #2b3035 0%, #1a1d21 100%);
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1;
    border-radius: 8px;
    top: 100%;
    left: 0;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-content a {
    color: white;
    padding: 12px 0;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background: none;
    color: #007bff !important;
}

.dropdown-content a > span {
    display: block;
    padding: 0 8px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content .dropdown > a.dopbtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: white;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

#lang-switcher {
    position: absolute;
    right: 4rem;
    top: 50%;
    transform: translateY(-50%);
}

#lang-switcher .dopbtn {
    background: linear-gradient(135deg, #3b4045 0%, #2a2f35 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

#lang-switcher .dopbtn:hover {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#lang-switcher .dropdown-content {
    position: absolute;
    background: linear-gradient(135deg, #3b4045 0%, #2a2f35 100%);
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1;
    top: 100%;
    left: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#lang-switcher .dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#lang-switcher .dropdown-content a:hover {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white !important;
}

#top-nav ul li.dropdown > a.dopbtn {
    display: inline-flex !important; /* Permite alinear texto e iconos en una línea */
    align-items: center;         /* Centra verticalmente los elementos */
    gap: 0.5rem;                 /* Añade un espacio entre el texto y los iconos */
}

/* Mobile Menu Toggle */
#mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2000;
}

#mobile-menu-toggle span {
    width: 2rem;
    height: 0.25rem;
    background: white;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* IP Form Styles */
#ip-form {
    width: auto;
    margin-bottom: 1rem;
}

#ip-input-container {
    display: flex;
    width: auto;
    gap: 0;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.2));
}

#ip-input {
    width: 270px;
    padding: 1rem 1.2rem;
    border: 2px solid #555;
    border-radius: 25px 0 0 25px;
    font-size: 1rem;
    background: linear-gradient(135deg, #3b4045 0%, #2a2f35 100%);
    color: white;
    transition: all 0.3s ease;
    outline: none;
}

#ip-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #3b4045 0%, #2a2f35 100%);
}

#ip-input::placeholder {
    color: #bbb;
}

#ip-form button {
    padding: 1rem 1.2rem;
    border: none;
    border-radius: 50%;
    width: 3.8rem;
    height: 3.8rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -1.9rem;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

#ip-form button svg {
    width: 20px;
    height: 20px;
    stroke: white;
    vertical-align: middle;
}

#ip-form button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

/* IP Basic Information Card */
#ip-display-card {
    background: linear-gradient(135deg, #2c313a 0%, #1e2328 100%);
    color: #ffffff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#ip-display-card h1 {
    font-size: 1.8rem;
    color: #bbb;
    font-weight: 400;
    margin: 0;
}

#main-ip-address {
    font-size: 3.5rem;
    font-weight: 700;
    color: #007bff;
    margin: -1rem 0;
    text-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

/* Boton Copiar al portapapeles */
.ip-address-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

#copy-ip-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    line-height: 0;
    transition: background 0.2s ease-in-out;
}

#copy-ip-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

#copy-ip-button svg {
    width: 3.5rem;
    height: 3.5rem;
    color: #007bff;
    stroke-width: 2.5;
}

/* Fin Boton Copiar al portapapeles */

#basic-info {
    font-size: 1.1rem;
    color: #bbb;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    width: 80%;
}

#basic-info img {
    width: 22px;
    vertical-align: middle;
    margin-left: 8px;
    border-radius: 2px;
}

#details-button {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
}

#details-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

/* IP Details Card */
#ip-details-card {
    position: relative;
    padding: 5rem 2.5rem 2.5rem 2.5rem;
    background: linear-gradient(135deg, #2c313a 0%, #1e2328 100%);
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    margin-top: 2rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#ip-details-card h2 {
    font-size: 1.6rem;
    color: #007bff;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

#details-ip-address {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.details-map-container {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

#map {
    width: 100%;
    height: 100%;
}

#ip-details-card hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    margin-bottom: 1.5rem;
}

#ip-details-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    line-height: 1.8;
}

#ip-details-card ul li {
    font-size: 1rem;
    color: #bbb;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

#ip-details-card ul li:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(4px);
}

#ip-details-card ul li:last-child {
    border-bottom: none;
}

#ip-details-card ul strong {
    color: #ffffff;
    margin-right: 1rem;
    font-weight: 600;
}

#back-button {
    position: absolute;
    top: 1.5rem;
    left: 2.5rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
}

#back-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

/* Mapa leaflet */
.leaflet-control-zoom {
    border: none; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); 
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: linear-gradient(135deg, #3f444b 0%, #2c313a 100%); /* Fondo oscuro como las tarjetas */
    color: white !important; 
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white !important;
}

.leaflet-control-zoom a + a {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
    margin-top: auto;
    width: 100%;
    padding: 1.5rem 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(43, 48, 53, 0.9) 0%, rgba(26, 29, 33, 0.9) 100%);
    font-size: 0.9rem;
    color: #bbb;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 404 Error Page Styles */
.error-404-container {
    text-align: center;
    margin-top: 5rem;
    color: white;
    padding: 2rem;
    background: linear-gradient(135deg, #2c313a 0%, #1e2328 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    max-width: 600px;
    margin: 5rem auto;
}

.error-404-container h1 {
    font-size: 6rem;
    margin-bottom: 1rem;
    color: #007bff;
    text-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    font-weight: 700;
}

.error-404-container p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #bbb;
}

.error-404-container a {
    font-size: 1.2rem;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
}

.error-404-container a:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

/* Responsive Styles */
@media (max-width: 768px) {
    #top-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    #logo-container img {
        height: 30px;
    }

    #ip-tool-header {
        padding: 1rem;
    }

    .header-content {
        justify-content: space-between;
    }

    #main-nav-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 3rem;
        padding-top: 6rem;  
        background: linear-gradient(135deg, rgba(43, 48, 53, 0.95) 0%, rgba(26, 29, 33, 0.95) 100%);
        backdrop-filter: blur(10px);
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100%;
        z-index: 1500;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    #ip-details-card {
        padding: 5rem 1.5rem 1.5rem;
        max-width: 95%;
    }

    #details-ip-address {
        font-size: 1.8rem;
    }

    .details-map-container {
        height: 250px;
    }

    #ip-details-card ul li {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.25rem;
        font-size: 0.95rem;
    }

    #back-button {
        left: 1.5rem;
        padding: 0.6rem 1.2rem;
    }

    #mobile-menu-toggle {
        display: flex;
    }

    body.mobile-menu-open #lang-switcher {
        position: absolute;
        top: 2.4rem;
        left: 1rem;
    }

    body.mobile-menu-open #lang-switcher .dopbtn {
        width: fit-content;
    }

    body.mobile-menu-open #main-nav-container {
        transform: translateX(0);
    }

    body.mobile-menu-open #mobile-menu-toggle span:nth-child(1) {
        transform: rotate(45deg);
    }
    
    body.mobile-menu-open #mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    
    body.mobile-menu-open #mobile-menu-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }

    #ip-display-card {
        padding: 2rem;
        gap: 1rem;
        margin: 1rem;
    }

    #main-ip-address {
        font-size: 2.5rem;
    }

    #ip-input {
        width: 240px;
    }

    .error-404-container {
        margin: 2rem 1rem;
        padding: 2rem 1rem;
    }

    .error-404-container h1 {
        font-size: 4rem;
    }

    .error-404-container p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    #ip-input {
        width: 200px;
        padding: 0.8rem 1rem;
    }

    #ip-form button {
        width: 3.2rem;
        height: 3.2rem;
        margin-left: -1.6rem;
    }

    #main-ip-address {
        font-size: 2rem;
    }

    #ip-display-card {
        padding: 1.5rem;
    }

    .error-404-container h1 {
        font-size: 3rem;
    }
}