/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    will-change: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ip-display {
    width: 100%;
    max-width: 800px;
}

/* Loading animation */
.loading {
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* IP Cards */
.ip-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.ip-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.ip-card:hover::before {
    left: 100%;
}

.ip-card.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 0;
}

.ip-card.local-ip {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.ip-card.primary .card-header h2 {
    color: white;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.card-header i {
    font-size: 1.5rem;
    color: #667eea;
    width: 24px;
    text-align: center;
}

.ip-card.primary .card-header i {
    color: white;
}

.card-header h2, .card-header h3 {
    font-weight: 600;
    color: #333;
}

.card-header h2 {
    font-size: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
}

.ip-address {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 500;
}

.flag {
    font-size: 1.5rem;
}

/* Details grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Status badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.status-badge.yes {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.status-badge.no {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.status-badge.unknown {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* Loading animations */
.loading-text {
    background: linear-gradient(90deg, #666 0%, #999 50%, #666 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Performance optimizations for cards */
.ip-card {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Error state */
.error {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

.error-content {
    background: rgba(255, 59, 48, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.error i {
    font-size: 3rem;
    color: #ff3b30;
    margin-bottom: 20px;
}

.error h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.error p {
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .ip-cards-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .ip-address {
        font-size: 2rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .ip-address {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .ip-card {
        padding: 20px;
    }
}

/* Animation for cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ip-card {
    animation: fadeInUp 0.6s ease forwards;
}

.ip-card:nth-child(1) { animation-delay: 0.1s; }
.ip-card:nth-child(2) { animation-delay: 0.2s; }
.ip-card:nth-child(3) { animation-delay: 0.3s; }
.ip-card:nth-child(4) { animation-delay: 0.4s; }
.ip-card:nth-child(5) { animation-delay: 0.5s; }
.ip-card:nth-child(6) { animation-delay: 0.6s; }

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.copy-notification.show {
    transform: translateX(0);
}
