html, body {
    font-family: 'Quantico', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure page takes full height for sticky footer */
.page {
    min-height: 100vh;
    min-height: 100dvh; /* Use dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Main content area should grow to fill available space */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex items to shrink */
}

/* Content area should take remaining space, pushing footer down */
.content {
    flex: 1;
    padding-top: 1.1rem;
    min-height: 0; /* Allow flex items to shrink */
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Loading screen styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

/* Loading logo with 8-bit retro styling - ONLY for loading page */
.loading-container .loading-logo {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    margin-bottom: 2rem;
    border-radius: 0; /* Sharp corners for pixel art feel */
    image-rendering: pixelated; /* Makes image crisp/pixelated */
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    animation: 
        pixel8BitBounce 1s ease-in-out infinite,
        pixel8BitGlow 2s linear infinite,
        pixel8BitFlicker 0.5s steps(4) infinite;
    transition: none; /* Remove smooth transitions for sharp 8-bit feel */
    filter: contrast(1.2) saturate(1.5);
}

/* Hover effect for 8-bit style */
.loading-container .loading-logo:hover {
    animation-play-state: paused;
    transform: scale(1.25);
    filter: contrast(1.4) saturate(2) brightness(1.2);
}

/* Responsive logo sizing - maintaining pixel perfect scaling */
@media (max-width: 768px) {
    .loading-container .loading-logo {
        width: 64px !important;
        height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .loading-container .loading-logo {
        width: 48px !important;
        height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        margin-bottom: 1rem;
    }
}

/* 8-bit style bounce animation */
@keyframes pixel8BitBounce {
    0%, 100% { 
        transform: translateY(0px) scale(1);
    }
    25% { 
        transform: translateY(-4px) scale(1.05);
    }
    50% { 
        transform: translateY(-8px) scale(1.1);
    }
    75% { 
        transform: translateY(-4px) scale(1.05);
    }
}

/* 8-bit glow effect with color cycling */
@keyframes pixel8BitGlow {
    0% { 
        filter: contrast(1.2) saturate(1.5) hue-rotate(0deg);
    }
    25% { 
        filter: contrast(1.2) saturate(1.5) hue-rotate(90deg);
    }
    50% { 
        filter: contrast(1.2) saturate(1.5) hue-rotate(180deg);
    }
    75% { 
        filter: contrast(1.2) saturate(1.5) hue-rotate(270deg);
    }
    100% { 
        filter: contrast(1.2) saturate(1.5) hue-rotate(360deg);
    }
}

/* 8-bit flicker effect */
@keyframes pixel8BitFlicker {
    0%, 90%, 100% { 
        opacity: 1;
    }
    92%, 98% { 
        opacity: 0.95;
    }
    94%, 96% { 
        opacity: 0.9;
    }
}

/* Loading bars animation */
.loading-bars {
    display: flex;
    justify-content: center;
    align-items: end;
    height: 40px;
    margin: 0 auto 1rem auto;
    gap: 4px;
}

.loading-bars div {
    width: 4px;
    background: #1b6ec2;
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.loading-bars .bar1 { animation-delay: 0s; }
.loading-bars .bar2 { animation-delay: 0.1s; }
.loading-bars .bar3 { animation-delay: 0.2s; }
.loading-bars .bar4 { animation-delay: 0.3s; }
.loading-bars .bar5 { animation-delay: 0.4s; }

@keyframes wave {
    0%, 40%, 100% {
        height: 5px;
        opacity: 0.5;
    }
    20% {
        height: 30px;
        opacity: 1;
    }
}

.loading-progress-text {
    text-align: center;
    font-weight: bold;
    margin-top: 1rem;
    font-family: 'Quantico', monospace;
    color: #1b6ec2;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Description panel styles */
.description-panel {
    margin: 0 auto;
    max-width: 600px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}

/* Specifically target the description panel card header */
.description-panel .card .card-header {
    padding: 0.25rem 1rem !important;
    min-height: 32px !important;
    height: 32px !important;
    box-sizing: border-box !important;
}

.description-panel .card .card-header h5 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    font-weight: 500 !important;
}

/* Apply ultra-compact styling to all card headers */
.card .card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.25rem 1rem !important;
    min-height: 32px !important;
    height: 32px !important;
    box-sizing: border-box !important;
}

.card .card-header h4,
.card .card-header h5 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    font-weight: 500 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* IP Input styling for IPv6 support */
.ip-input {
    width: 500px;
    max-width: 90vw;
    font-family: 'Quantico', monospace;
    font-size: 0.8rem;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin-right: 10px;
    margin-bottom: 20px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-align: center;
}

.ip-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ip-input::placeholder {
    color: #6c757d;
    opacity: 1;
    text-align: center;
}

/* Button spacing */
.btn {
    margin-bottom: 20px;
}

/* JSON display container - simplified and cleaned up */
.json-container {
    max-width: 95vw;
    width: 95vw;
    overflow-x: auto;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

/* Ensure pre elements don't break layout */
pre {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Base footer icon styling - scaled up and better spacing */
.footer img {
    width: 40px !important;
    height: auto !important;
    max-width: 40px;
    max-height: 40px;
    margin: 0 8px;
    transition: transform 0.2s ease-in-out;
    display: inline-block;
    object-fit: contain;
}

.footer img:hover {
    transform: scale(1.15);
}

/* Footer layout override to center cloud logos with search box */
.footer {
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.build-number {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.cloud-logos {
    justify-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Wide screen display optimizations */
@media (min-width: 1200px) {
    .content {
        max-width: 1140px;
        margin: 0 auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
      /* Scale input width on wide screens */
    .ip-input {
        width: 450px;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* Limit card width on wide screens */
    .card-container {
        max-width: 900px;
        margin: 0 auto;
    }
    
    /* Reduce header sizes on wide screens */
    h1 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }    /* Footer scaling for wide screens */
    .footer {
        padding: 12px calc((100vw - 1140px) / 2 + 15px);
    }
    
    .footer img {
        width: 45px !important;
        height: 45px !important;
        max-width: 45px;
    }
      .build-number {
        font-size: 0.75rem;
    }
}

@media (min-width: 1400px) {
    .content {
        max-width: 1320px;
    }
      /* Further scale input width for very wide screens */
    .ip-input {
        width: 420px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.45rem 0.9rem;
    }
    
    /* More conservative sizing for ultra-wide screens */
    .card-container {
        max-width: 800px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }    /* Footer scaling for extra wide screens */
    .footer {
        padding: 10px calc((100vw - 1320px) / 2 + 15px);
    }
    
    .footer img {
        width: 42px !important;
        height: 42px !important;
        max-width: 42px;
    }
      .build-number {
        font-size: 0.7rem;
    }
}

@media (min-width: 1600px) {
    .content {
        max-width: 1400px;
    }
      /* Scale input width for 4K and ultra-wide monitors */
    .ip-input {
        width: 400px;
    }
    
    .card-container {
        max-width: 700px;
    }
    
    /* Keep text readable but not massive */
    body {
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }    /* Footer scaling for 4K and ultra-wide monitors */
    .footer {
        padding: 8px calc((100vw - 1400px) / 2 + 15px);
    }
    
    .footer img {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px;
    }
      .build-number {
        font-size: 0.65rem;
    }
}

/* Force reduced card headers - cache buster */
body .card .card-header {
    padding: 0.25rem 1rem !important;
    height: 32px !important;
    max-height: 32px !important;
    overflow: hidden !important;
}

body .card .card-header h4,
body .card .card-header h5 {
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .btn-sm {
    font-size: 0.75rem !important;
    padding: 0.125rem 0.25rem !important;
}

/* Ultra-high specificity CSS overrides for card headers */
html body div.card div.card-header {
    padding: 0.25rem 1rem !important;
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    line-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

html body div.card div.card-header h4,
html body div.card div.card-header h5 {
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    display: inline-block !important;
}

/* Specific targeting for Blazor components */
.description-panel .card .card-header,
.results .card .card-header,
.card-container .card .card-header {
    padding: 0.25rem 1rem !important;
    height: 32px !important;
    max-height: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

/* Override any Bootstrap default padding */
.card-header[class*="card-header"] {
    padding: 0.25rem 1rem !important;
    height: 32px !important;
}

/* Force card headers to be compact with consistent styling */
.card .card-header {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0.25rem 0.75rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
}

/* More specific targeting for card headers */
div.card div.card-header {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0.25rem 0.75rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
}

/* Ultra-specific targeting for card headers */
html body div.card div.card-header {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0.25rem 0.75rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
}

/* Ensure close button is properly centered within card headers */
.card .card-header .btn-close {
    padding: 0.125rem 0.25rem !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    width: 24px !important;
    flex-shrink: 0 !important;
}

/* More specific targeting for close buttons in card headers */
div.card div.card-header .btn-close {
    padding: 0.125rem 0.25rem !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    width: 24px !important;
    flex-shrink: 0 !important;
}

/* Ultra-specific targeting for close buttons */
html body div.card div.card-header .btn-close {
    padding: 0.125rem 0.25rem !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    width: 24px !important;
    flex-shrink: 0 !important;
}

/* Ensure all buttons in card headers are properly centered */
.card .card-header .btn {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

/* More specific targeting for buttons in card headers */
div.card div.card-header .btn {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

/* Ultra-specific targeting for buttons in card headers */
html body div.card div.card-header .btn {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

/* Mobile phone specific footer styling - compact for better space usage */
@media (max-width: 767px) {
    .footer {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 6px !important;
        text-align: center !important;
    }
    
    .build-number {
        margin-bottom: 6px !important;
        font-size: 0.65rem !important;
    }
    
    .build-label::after {
        content: "\A" !important;
        white-space: pre !important;
    }
    
    .build-label, .build-value {
        display: block !important;
        text-align: center !important;
    }
    
    .cloud-logos {
        text-align: center !important;
        margin-top: 3px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .footer img {
        width: 32px !important;
        height: auto !important;
        max-width: 32px !important;
        margin: 0 !important;
        display: inline-block !important;
    }
}

/* Extra small phone screens - even more compact */
@media (max-width: 480px) {
    .footer {
        padding: 4px !important;
    }
    
    .build-number {
        font-size: 0.6rem !important;
        margin-bottom: 4px !important;
    }
    
    .cloud-logos {
        gap: 6px !important;
        margin-top: 2px !important;
    }
    
    .footer img {
        width: 28px !important;
        max-width: 28px !important;
    }
}

/* Very small screens (narrow phones) - most compact */
@media (max-width: 360px) {
    .footer {
        padding: 3px !important;
    }
    
    .build-number {
        font-size: 0.55rem !important;
        margin-bottom: 3px !important;
    }
    
    .cloud-logos {
        gap: 4px !important;
        margin-top: 1px !important;
    }
    
    .footer img {
        width: 24px !important;
        max-width: 24px !important;
    }
}

/* Ensure footer is always visible and properly positioned */
.footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
    min-height: 60px !important;
    position: relative !important;
    z-index: 1000 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Force footer to bottom on all devices, especially mobile */
@media (max-width: 767px) {
    html, body {
        height: 100% !important;
        min-height: 100% !important;
        position: relative !important;
    }
    
    #app {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .page {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }
    
    main {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }
    
    .content {
        flex: 1 !important;
        min-height: calc(100vh - 120px) !important;
        min-height: calc(100dvh - 120px) !important;
        padding-bottom: 20px !important;
    }
    
    .footer {
        margin-top: auto !important;
        min-height: 80px !important;
        flex-shrink: 0 !important;
        position: relative !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1001 !important;
    }
}

/* Extra reinforcement for very small screens */
@media (max-width: 480px) {
    .content {
        min-height: calc(100vh - 140px) !important;
        min-height: calc(100dvh - 140px) !important;
    }
    
    .footer {
        min-height: 100px !important;
    }
}

/* Ensure footer is always visible on extra small screens */
@media (max-width: 360px) {
    .content {
        min-height: calc(100vh - 160px) !important;
        min-height: calc(100dvh - 160px) !important;
    }
    
    .footer {
        min-height: 120px !important;
    }
}

/* Mobile scaling for ASCII art images on phone screens */
@media (max-width: 767px) {
    /* CloudIPSearch ASCII art - scale up from 30% to 60% */
    img[alt="CloudIPSearch"] {
        width: 60% !important;
        max-width: 90% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    
    /* ASCII text art albatross - scale up from 10% to 25% */
    img[alt="ascii-text-art-albatross"] {
        width: 25% !important;
        max-width: 40% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    
    /* Main Albatross ASCII art - scale up from 50% to 75% */
    img[alt="Albatross"] {
        width: 75% !important;
        max-width: 85% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
}

@media (max-width: 480px) {
    /* CloudIPSearch ASCII art - even larger for small phones */
    img[alt="CloudIPSearch"] {
        width: 70% !important;
        max-width: 95% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    
    /* ASCII text art albatross - larger for small phones */
    img[alt="ascii-text-art-albatross"] {
        width: 30% !important;
        max-width: 45% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    
    /* Main Albatross ASCII art - larger for small phones */
    img[alt="Albatross"] {
        width: 85% !important;
        max-width: 95% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
}

@media (max-width: 360px) {
    /* CloudIPSearch ASCII art - maximum size for very small phones */
    img[alt="CloudIPSearch"] {
        width: 80% !important;
        max-width: 98% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
    
    /* ASCII text art albatross - maximum size for very small phones */
    img[alt="ascii-text-art-albatross"] {
        width: 35% !important;
        max-width: 50% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
      /* Main Albatross ASCII art - maximum size for very small phones */
    img[alt="Albatross"] {
        width: 90% !important;
        max-width: 98% !important;
        /* Add pixel-perfect rendering */
        image-rendering: pixelated !important;
        image-rendering: -moz-crisp-edges !important;
        image-rendering: crisp-edges !important;
        image-rendering: -webkit-optimize-contrast !important;
        -ms-interpolation-mode: nearest-neighbor !important;
    }
}

/* Search Results Container - Fixed to prevent layout shifting */
.search-results-container {
    min-height: 0; /* Remove fixed min-height that creates gaps */
    margin-top: 20px;
    transition: all 0.3s ease-in-out;
    max-width: none; /* Remove width constraint for JSON display */
    margin-left: auto;
    margin-right: auto;
    display: block; /* Ensure proper block layout */
    clear: both;
}

.search-results-container.has-results {
    min-height: auto;
}

.search-results-container.searching {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px; /* Only apply min-height when actively searching */
    max-width: 800px; /* Constrain width only during search */
    margin-left: auto;
    margin-right: auto;
}

.results {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-match {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease-in-out;
    max-width: 600px; /* Constrain individual box width */
    margin-left: auto;
    margin-right: auto;
}

.service-match:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.service-match strong {
    color: #495057;
    font-weight: 600;
}

.service-match .text-muted {
    color: #6c757d !important;
    font-size: 0.875rem;
}

/* Responsive design for service match boxes */
@media (max-width: 768px) {
    .search-results-container {
        max-width: 100%;
        margin-left: 15px;
        margin-right: 15px;
    }
    
    .service-match {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .search-results-container {
        max-width: 700px;
    }
    
    .service-match {
        max-width: 550px;
    }
}

@media (min-width: 1025px) {
    .search-results-container {
        max-width: 800px;
    }
    
    .service-match {
        max-width: 600px;
    }
}

/* Loading wave bars positioning - replaces spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.spinner-container .loading-bars {
    display: flex;
    justify-content: center;
    align-items: end;
    height: 40px;
    margin: 0 auto 1rem auto;
    gap: 4px;
}

.spinner-container .loading-bars div {
    width: 4px;
    background: #1b6ec2;
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

/* Abuse check specific wave bars - match warning button color */
.loading-bars.abuse-check div {
    background: #ffc107 !important; /* Warning button color - force override */
}

.spinner-container .loading-bars .bar1 { animation-delay: 0s; }
.spinner-container .loading-bars .bar2 { animation-delay: 0.1s; }
.spinner-container .loading-bars .bar3 { animation-delay: 0.2s; }
.spinner-container .loading-bars .bar4 { animation-delay: 0.3s; }
.spinner-container .loading-bars .bar5 { animation-delay: 0.4s; }

.spinner-border {
    /* Hide default spinner border - replaced with wave bars */
    display: none;
}

/* Special handling for IP reputation results to allow wider JSON display */
.search-results-container .results.card-container {
    max-width: 95vw !important; /* Bypass search container limits for JSON */
    width: 95vw !important;
    margin: 0 auto;
    display: block;
    position: relative; /* Break out of parent constraints */
}

/* Make JSON results break out of search-results-container width limits */
.search-results-container .results.card-container {
    /* Calculate negative margins to center within viewport instead of parent */
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    left: 0 !important;
    right: 0 !important;
}

/* Ensure the card itself can expand for JSON */
.search-results-container .results.card-container .card {
    max-width: none;
    width: 100%;
    margin: 0 auto;
}

/* Ensure card body expands for JSON content */
.search-results-container .results.card-container .card .card-body {
    max-width: none;
    width: 100%;
    padding: 0;
}

/* JSON output should use more screen width */
.json-output {
    max-width: 95vw;
    width: 95vw;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Ensure block-level layout for results sections */
.search-results-container {
    display: block !important; /* Prevent any flex/float issues */
    clear: both;
}

.search-results-container .results {
    display: block !important;
    clear: both;
    width: 100%;
    margin-bottom: 20px;
}

/* Override responsive card-container constraints specifically for JSON results */
@media (min-width: 1200px) {
    .search-results-container .results.card-container {
        max-width: 95vw !important; /* Override all width constraints for JSON */
        width: 95vw !important;
    }
}

@media (min-width: 1400px) {
    .search-results-container .results.card-container {
        max-width: 95vw !important; /* Override all width constraints for JSON */
        width: 95vw !important;
    }
}

@media (min-width: 1600px) {
    .search-results-container .results.card-container {
        max-width: 95vw !important; /* Override all width constraints for JSON */
        width: 95vw !important;
    }
}

/* Pixel matrix styles for ASCII art replacement */
.ascii-art-pixel-matrix {
    display: inline-block;
    margin: 0 auto;
    padding: 5px 0 0 5px;
    width: 50%;
    max-width: 1163px;
}

.pixel-matrix__grid {
    display: grid;
    grid-template-columns: repeat(240, 1fr);
    grid-auto-rows: auto;
    aspect-ratio: 1163 / 216;
    width: 100%;
    gap: 0;
    background: white;
    border: none;
}

.pixel-matrix__pixel {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
}

.pixel-matrix__pixel--empty {
    background-color: #ffffff;
}

.pixel-matrix__pixel--edge {
    background-color: #cccccc;
}

.pixel-matrix__pixel--mid {
    background-color: #888888;
}

.pixel-matrix__pixel--dark {
    background-color: #333333;
}

.pixel-matrix__pixel--core {
    background-color: #000000;
}

/* Responsive sizing for pixel matrix */
@media (max-width: 768px) {
    .ascii-art-pixel-matrix {
        width: 70%;
    }
}

@media (max-width: 480px) {
    .ascii-art-pixel-matrix {
        width: 90%;
    }
}

