/**
 * IP Detector Styles
 * Custom styles for IP detection functionality
 */

/* Header IP Status Styles */
.header-links .user-ip,
.header-links .user-location,
.header-links .user-status {
    font-weight: normal;
    transition: all 0.3s ease;
    font-size: inherit;
}

/* Loading animation */
.user-ip:contains("Loading"),
.user-location:contains("Loading"),
.user-status:contains("Checking") {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Status-specific colors */
.header-links li:has(.user-status) {
    transition: color 0.3s ease;
}

/* Protected status (VPN detected) - Verde */
.status-protected {
    color: #28a745 !important;
    font-weight: normal;
}

.status-protected i {
    color: #28a745 !important;
}

/* Not protected status (No VPN) - Rojo más visible */
.status-not-protected,
.status-not-protected *,
.header-links .status-not-protected,
.header-links .status-not-protected * {
    color: #dc3545 !important;
    font-weight: normal !important;
}

.status-not-protected i,
.header-links .status-not-protected i {
    color: #dc3545 !important;
}

/* Forzar color rojo en el span específico - SIN negrilla */
.status-not-protected .user-status,
.header-links .status-not-protected .user-status,
.user-status[data-status="not-protected"],
span[data-status="not-protected"] {
    color: #dc3545 !important;
    font-weight: normal !important;
    /* Removemos el background y border para que sea más limpio */
}

/* Regla súper específica para override */
.header-links li:has(.user-status[data-status="not-protected"]) {
    color: #dc3545 !important;
}

.header-links li:has(.user-status[data-status="not-protected"]) i {
    color: #dc3545 !important;
}

/* Unknown status - Amarillo */
.status-unknown {
    color: #ffc107 !important;
    font-weight: normal;
}

.status-unknown i {
    color: #ffc107 !important;
}

/* Additional styling for better visibility */
.header-links .user-status {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Header-specific overrides - CLEAN DESIGN */
.header-links .user-ip,
.header-links .user-location,
.header-links .user-status {
    font-weight: normal !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Ensure header maintains original layout */
.header-links li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Status colors for header - CLEAN VERSION */
.header-links .status-protected,
.header-links .status-protected * {
    color: #28a745 !important;
    font-weight: normal !important;
}

.header-links .status-not-protected,
.header-links .status-not-protected * {
    color: #dc3545 !important;
    font-weight: normal !important;
}

.header-links .status-unknown,
.header-links .status-unknown * {
    color: #ffc107 !important;
    font-weight: normal !important;
}

/* Tooltip styles */
.user-status[title] {
    cursor: help;
    position: relative;
}

.user-status[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.user-status[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-links li {
        font-size: 12px;
    }
    
    .user-ip,
    .user-location,
    .user-status {
        font-size: 11px;
    }
}

/* Loading spinner for better UX */
.ip-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.ip-error {
    color: #dc3545;
    font-style: italic;
}

/* Success state */
.ip-success {
    color: #28a745;
}

/* VPN Badge */
.vpn-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    text-transform: uppercase;
}

.no-vpn-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    text-transform: uppercase;
}

/* Refresh button (if needed) */
.ip-refresh-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.ip-refresh-btn:hover {
    opacity: 1;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .user-status[title]:hover::after {
        background: rgba(255, 255, 255, 0.9);
        color: black;
    }
    
    .user-status[title]:hover::before {
        border-top-color: rgba(255, 255, 255, 0.9);
    }
}
