* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: hsl(0, 0%, 98%);
    min-height: 100vh;
    padding: 20px;
    color: hsl(0, 0%, 9%);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0 30px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 600;
    color: hsl(0, 0%, 9%);
}

.subtitle {
    font-size: 1em;
    color: hsl(0, 0%, 45%);
}

.main-content {
    display: grid;
    gap: 25px;
}

.card {
    background: hsl(0, 0%, 100%);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid hsl(0, 0%, 90%);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card h3 {
    color: hsl(0, 0%, 9%);
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    border-bottom: 1px solid hsl(0, 0%, 90%);
    padding-bottom: 12px;
}

.query-form {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.ip-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid hsl(0, 0%, 89%);
    border-radius: 6px;
    font-size: 0.95em;
    background: hsl(0, 0%, 100%);
    color: hsl(0, 0%, 9%);
    transition: all 0.2s;
}

.ip-input:focus {
    outline: none;
    border-color: hsl(0, 0%, 9%);
    box-shadow: 0 0 0 3px hsl(0, 0%, 95%);
}

.ip-input::placeholder {
    color: hsl(0, 0%, 60%);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-primary {
    background: hsl(0, 0%, 9%);
    color: hsl(0, 0%, 98%);
}

.btn-primary:hover {
    background: hsl(0, 0%, 20%);
}

.btn-primary:active {
    background: hsl(0, 0%, 0%);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint {
    color: hsl(0, 0%, 55%);
    font-size: 0.85em;
    margin-top: 8px;
}

.result-container {
    margin-top: 24px;
    animation: fadeIn 0.3s ease;
}

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

.result-box {
    background: hsl(0, 0%, 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid hsl(0, 0%, 90%);
}

.result-success {
    border-left: 3px solid hsl(0, 0%, 9%);
}

.result-error {
    border-left: 3px solid hsl(0, 0%, 40%);
    background: hsl(0, 0%, 97%);
}

.result-title {
    font-weight: 600;
    color: hsl(0, 0%, 9%);
    margin-bottom: 20px;
    font-size: 1.05em;
}

.section-title {
    color: hsl(0, 0%, 9%);
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-weight: 500;
    color: hsl(0, 0%, 45%);
    font-size: 0.85em;
}

.info-value {
    color: hsl(0, 0%, 9%);
    font-size: 0.95em;
    padding: 8px 12px;
    background: hsl(0, 0%, 98%);
    border: 1px solid hsl(0, 0%, 90%);
    border-radius: 6px;
    word-break: break-all;
}

.section-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid hsl(0, 0%, 90%);
}

.full-address-section {
    margin-bottom: 15px;
}

.full-address-display {
    font-size: 1.2em;
    font-weight: 600;
    color: hsl(0, 0%, 9%);
    padding: 16px 20px;
    background: linear-gradient(135deg, hsl(0, 0%, 97%) 0%, hsl(0, 0%, 99%) 100%);
    border: 2px solid hsl(0, 0%, 9%);
    border-radius: 8px;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.error-message {
    color: hsl(0, 0%, 30%);
    font-weight: 500;
    padding: 12px 16px;
    background: hsl(0, 0%, 95%);
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid hsl(0, 0%, 85%);
}

.loading {
    display: inline-block;
    color: hsl(0, 0%, 45%);
    animation: pulse 1.5s ease-in-out infinite;
}

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

footer {
    text-align: center;
    color: hsl(0, 0%, 55%);
    margin-top: auto;
    padding: 40px 20px 20px;
    font-size: 0.9em;
    width: 100%;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .info-item.full-width {
        grid-column: 1 / -1;
    }
}
