/* Reset e Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #f8f8f8;
    background: linear-gradient(to bottom, #000, #b30000);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px #b3000099;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-content {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    color: #f8f8f8;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px #b3000099;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #ffd6d6;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards Base Style */
.ip-card,
.search-card,
.geo-card,
.map-card,
.error-card {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.15);
    color: #f8f8f8;
}

/* IP Section */
.ip-section {
    margin-bottom: 2rem;
}

.ip-header {
    text-align: center;
}

.ip-header h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 500;
}

.ip-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #b30000, #ff3333);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(179, 0, 0, 0.3);
}

.ip-address {
    margin-right: 0.5rem;
    font-family: 'Courier New', monospace;
}

.ip-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.ip-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-card h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-form {
    margin-bottom: 1rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.search-input-group input[type="text"] {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.search-input-group input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input-group input[type="text"].valid {
    border-color: #28a745;
}

.search-input-group input[type="text"].invalid {
    border-color: #dc3545;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #b30000, #ff3333);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    background: #ff3333;
    color: #fff;
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #2d0000;
    border-radius: 8px;
    border-left: 4px solid #b30000;
    font-size: 0.9rem;
    color: #fff;
}

.reset-link {
    color: #ff3333;
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.reset-link:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Geo Section */
.geo-section {
    margin-bottom: 2rem;
}

.geo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.geo-header h3 {
    font-size: 1.3rem;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px #b3000099;
}

.ip-label {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.geo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.geo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(40, 0, 0, 0.7);
    border-radius: 12px;
    border-left: 4px solid #b30000;
    color: #f8f8f8;
}

.geo-item .label {
    font-weight: 600;
    color: #fff;
}

.geo-item .value {
    color: #ffd6d6;
    text-align: right;
    font-weight: 500;
}

/* Map Section */
.map-section {
    margin-bottom: 2rem;
}

.map-header {
    margin-bottom: 1.5rem;
}

.map-header h3 {
    font-size: 1.3rem;
    color: #fff;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 8px #b3000099;
}

.map-container {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.map-warning {
    text-align: center;
    padding: 1rem;
    background: #2d0000;
    color: #ffb3b3;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #b30000;
}

/* Error Messages */
.error-message,
.error-card {
    background: #3a0000;
    color: #ffb3b3;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #ff3333;
    margin-bottom: 1rem;
    text-align: center;
}

.error-card h3 {
    margin-bottom: 0.5rem;
    color: #721c24;
}

/* Footer */
.footer {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 0, 0, 0.15);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    text-align: center;
    color: #ffd6d6;
}

.footer-content a {
    color: #ff3333;
    text-decoration: none;
    font-weight: 600;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Map Popup Styling */
.map-popup {
    text-align: center;
    font-family: inherit;
}

.map-popup h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.map-popup p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .search-input-group {
        flex-direction: row;
    }
    
    .geo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-container {
        height: 500px;
    }
}

@media (min-width: 1024px) {
    .hero-content {
        padding: 4rem 3rem;
    }
    
    .geo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .map-container {
        height: 600px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
a:focus,
button:focus,
input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .search-btn,
    .ip-badge {
        border: 2px solid #000;
    }
    
    .search-input-group input[type="text"] {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .search-section,
    .map-section,
    .footer {
        display: none;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .search-section,
    .map-section,
    .footer {
        display: none;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .hero-content,
    .ip-card,
    .geo-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(to bottom, #000, #b30000);
        color: #f8f8f8;
    }
    
    .header,
    .hero-content,
    .ip-card,
    .search-card,
    .geo-card,
    .map-card,
    .error-card,
    .footer {
        background: rgba(20, 20, 20, 0.85);
        color: #f8f8f8;
        border: 1px solid rgba(255, 0, 0, 0.15);
    }
    
    .geo-item {
        background: rgba(40, 0, 0, 0.7);
    }
    
    .search-input-group input[type="text"] {
        background: rgba(40, 0, 0, 0.7);
        color: #fff;
        border-color: #b30000;
    }
    
    .hero-title,
    .geo-header h3,
    .map-header h3 {
        color: #fff;
    }
    
    .hero-subtitle {
        color: #ffd6d6;
    }
}

.goto-map-link {
    margin-left: 1rem;
    color: #ff3333;
    background: rgba(0,0,0,0.15);
    padding: 0.2em 0.7em;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px #b3000033;
}
.goto-map-link:hover, .goto-map-link:focus {
    background: #ff3333;
    color: #fff;
    outline: 2px solid #fff;
    text-decoration: underline;
} 