/* Modern Design Styles - Bento Grid + Glassmorphism */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
    background-clip: padding-box;
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06),
                0 2px 8px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08),
                0 4px 12px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    grid-auto-flow: dense;
}

.bento-card {
    border-radius: 20px;
    overflow: hidden;
}

.bento-large {
    grid-column: span 2;
    grid-row: span 1;
}

@media (max-width: 768px) {
    .bento-large {
        grid-column: span 1;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

.bento-mini-card {
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-mini-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* Soft Shadows */
.shadow-soft {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 1px 4px rgba(0, 0, 0, 0.04);
}

.shadow-soft-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Primary Button with Micro-animation */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3),
                0 2px 4px rgba(59, 130, 246, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4),
                0 4px 8px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Input with button inside */
input#ipAddress {
    padding-right: 8.5rem;
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #1f2937;
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

/* Result Item Styling */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: all 0.2s ease;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    padding-left: 4px;
    padding-right: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    margin: 0 -4px;
}

.result-label {
    font-weight: 500;
    color: #6b7280;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.result-label i {
    margin-right: 0.5rem;
    width: 18px;
    text-align: center;
    font-size: 1rem;
    color: #9ca3af;
}

.result-value {
    color: #111827;
    font-weight: 600;
    text-align: right;
    font-size: 0.875rem;
}

/* Status Badges with Soft Design */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0.25rem 0.25rem 0.25rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.status-badge i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.status-badge.success {
    background: rgba(209, 250, 229, 0.7);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.warning {
    background: rgba(254, 243, 199, 0.7);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

.status-badge.danger {
    background: rgba(254, 226, 226, 0.7);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

.status-badge.info {
    background: rgba(219, 234, 254, 0.7);
    color: #1e40af;
    border-color: rgba(59, 130, 246, 0.2);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation for Bento Cards */
.bento-card {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.bento-card:nth-child(1) { animation-delay: 0.1s; }
.bento-card:nth-child(2) { animation-delay: 0.2s; }
.bento-card:nth-child(3) { animation-delay: 0.3s; }
.bento-card:nth-child(4) { animation-delay: 0.4s; }
.bento-card:nth-child(5) { animation-delay: 0.5s; }
.bento-card:nth-child(6) { animation-delay: 0.6s; }

/* Map Container */
#mapContainer {
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    overflow: hidden;
}

/* JSON Code Block */
pre code {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
}

/* Input Focus Animation */
input:focus {
    outline: none;
    animation: inputPulse 0.3s ease;
}

@keyframes inputPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }
}

/* Copy Button Animation */
@keyframes copySuccess {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #10b981;
    }
}

.copy-success {
    animation: copySuccess 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon Styling */
.fas, .far, .fab, .fal, .fad {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    transition: transform 0.2s ease;
}

/* Hover Effects for Icons in Cards */
.bento-card:hover .fas,
.bento-card:hover .far {
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-value {
        text-align: left;
        width: 100%;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .glass-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    /* Input button on mobile */
    input#ipAddress {
        padding-right: 3.5rem !important;
        font-size: 0.875rem;
    }
    
    .btn-primary {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8125rem;
        min-width: auto;
    }
    
    .btn-primary span {
        display: none;
    }
    
    .btn-primary i {
        margin: 0 !important;
    }
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth Transitions */
* {
    transition-property: transform, box-shadow, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Enhanced Button States */
button:not(:disabled):hover {
    transform: translateY(-1px);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Card Hover Micro-interactions */
.bento-card {
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.bento-card:hover::before {
    left: 100%;
}