/* myip-style.css */

/* Target the clock font size specifically on the IP page */
#ipAddress {
    /* Use a slightly smaller max size for the IP on desktop/tablet to keep it clean */
    font-size: clamp(60px, 12vw, 120px); 
}

/* Aggressive adjustment for small mobile screens (e.g., phones) */
@media (max-width: 550px) {
    #ipAddress {
        /* Reduce the responsive font size and the minimum size */
        /* This ensures the IP fits entirely on one line without clipping or needing a smaller font */
        font-size: clamp(48px, 10vw, 100px); 
        /* Ensure the line height is minimal to save vertical space */
        line-height: 1; 
    }
}

/* Ensure the map container has a fixed height to display */
#ipMap {
    height: 350px; 
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 0; /* Remove padding as map needs full container space */
    overflow: hidden; /* Ensures the map doesn't overflow rounded corners */
}

/* Leaflet map-specific style overrides */
.leaflet-container {
    background: var(--card); /* Match the background of your dark theme */
}

/* Add this to myip-style.css to style the marker popup */

/* Dark style for the Leaflet popup container */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: var(--card); /* Your dark card background color */
    color: var(--fg);         /* Your light foreground text color */
    box-shadow: var(--shadow); /* Your card shadow */
    border-radius: 12px;
    padding: 7px !important;
}

.leaflet-touch .leaflet-control-attribution {
	display: none;
}

.leaflet-control-layers {
	display: none;
}

.leaflet-touch .leaflet-bar a:last-child {
    display: none;
}

.leaflet-touch .leaflet-bar a {
    display: none;
}

/* --- Details Grid and Info Cards --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.info-card {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.info-card .info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 15px;
    color: var(--muted);
}

.info-card .info-list li {
    margin-bottom: 8px;
}

.info-card .info-list strong {
    color: var(--fg);
}

.info-card .prominent-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 10px 0;
}

.info-card small {
    font-size: 13px;
    color: var(--muted);
}

/* --- Custom Speed Test UI --- */
.speed-test-ui {
    text-align: center;
    margin-top: 15px;
}

.speed-gauge {
    margin-bottom: 20px;
}

.speed-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.speed-unit {
    font-size: 16px;
    font-weight: 700;
    color: var(--muted);
}

.speed-details {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 25px;
}

.speed-details span {
    font-weight: 700;
    color: var(--fg);
}

#startSpeedTestBtn {
    width: 100%;
}

/* --- Pulsing Animation for the Timezone Chip --- */

/* Defines the keyframes for the pulse effect */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 63, 86, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(224, 63, 86, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 63, 86, 0);
  }
}

/* Applies the animation to the specific chip on the homepage */
#ipLocation {
  animation: pulse 2s infinite;
}

/* --- Sidebar Mini-Map --- */
#sidebarMap {
    height: 200px;
    margin-top: 20px;
    border-radius: 12px;
    background-color: var(--chip);
}

/* --- Pulsing Dot Map Marker --- */
@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(224, 63, 86, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(224, 63, 86, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(224, 63, 86, 0);
  }
}

/* This is the invisible container that Leaflet will position */
.pulsing-dot-marker {
  position: relative;
}

/* This is the visible dot, centered inside the container */
.pulsing-dot-marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--accent-color);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  animation: pulse-dot 2s infinite;
}

/* --- IP Lookup Section --- */
.ip-lookup-section {
    margin-top: 60px;
}

#ipLookupResult {
    margin-top: 30px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
}

#ipLookupResult h3 {
    margin-top: 0;
}

/* --- IP Lookup Result Map --- */
#lookupMap {
    height: 200px;
    margin-top: 20px;
    border-radius: 12px;
    background-color: var(--chip);
}